forked from EduCraft/curriculum-project-hub
feat: redesign Feishu project console
This commit is contained in:
@@ -262,6 +262,30 @@ describe("ADR-0021 project onboarding", () => {
|
||||
});
|
||||
expect(oldChatGrant).toBeNull();
|
||||
});
|
||||
|
||||
it("rejects selecting an Agent role from another Organization at the database boundary", async () => {
|
||||
await seedUser("u-owner", "ou_owner", "OWNER");
|
||||
const project = await createProjectFromOrgAdmin(prisma, {
|
||||
organizationId: DEFAULT_ORG_ID,
|
||||
actorFeishuOpenId: "ou_owner",
|
||||
name: "Tenant-scoped role project",
|
||||
workspaceRoot: await tempWorkspaceRoot(),
|
||||
});
|
||||
await bindFeishuChatToProject(prisma, {
|
||||
projectId: project.projectId,
|
||||
actorFeishuOpenId: "ou_owner",
|
||||
chatId: "chat-tenant-role",
|
||||
});
|
||||
await seedTestOrganization("org_other", "other");
|
||||
const otherRole = await prisma.organizationAgentRole.findUniqueOrThrow({
|
||||
where: { organizationId_roleId: { organizationId: "org_other", roleId: "draft" } },
|
||||
});
|
||||
|
||||
await expect(prisma.projectGroupBinding.updateMany({
|
||||
where: { projectId: project.projectId, chatId: "chat-tenant-role", archivedAt: null },
|
||||
data: { selectedAgentRoleId: otherRole.id },
|
||||
})).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
async function seedUser(id: string, feishuOpenId: string, role: "OWNER" | "ADMIN" | "MEMBER"): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user