feat(platform): checkpoint current implementation state
This commit is contained in:
@@ -116,4 +116,32 @@ describe("assistant project admin delete tools", () => {
|
||||
error: "Project not found: project_1",
|
||||
}));
|
||||
});
|
||||
|
||||
it("returns a stable assistant error when the project cannot be resolved before deletion", async () => {
|
||||
const transaction = vi.fn();
|
||||
const ctx = createToolContext(
|
||||
{
|
||||
project: {
|
||||
findUnique: vi.fn().mockResolvedValue(null),
|
||||
findFirst: vi.fn().mockResolvedValue(null),
|
||||
},
|
||||
$transaction: transaction,
|
||||
},
|
||||
{
|
||||
userRole: SystemRole.ADMIN,
|
||||
permissions: [PermissionKey.MANAGE_PROJECTS],
|
||||
},
|
||||
);
|
||||
|
||||
const result = await executeTool(
|
||||
"delete_project",
|
||||
JSON.stringify({ projectId: "missing-project" }),
|
||||
ctx,
|
||||
);
|
||||
|
||||
expect(JSON.parse(result.content)).toEqual({
|
||||
error: "Project not found: missing-project",
|
||||
});
|
||||
expect(transaction).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user