test(dashboard): satisfy server.ts contract on sandbox-audit MockStore
routes-sandbox-audit.test.ts mocked @fusion/core without deterministicGuardLocks (causing the workflow-routes import to throw) and its MockStore lacked getDatabase, which createServer now calls when wiring ChatStore. Add both. Fixes 3 failing tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ vi.mock("@fusion/core", () => ({
|
||||
ChatStore: class MockChatStore {
|
||||
init = vi.fn().mockResolvedValue(undefined);
|
||||
},
|
||||
deterministicGuardLocks: new Map(),
|
||||
}));
|
||||
|
||||
vi.mock("../project-store-resolver.js", () => ({
|
||||
@@ -28,6 +29,16 @@ class MockStore {
|
||||
getFusionDir() {
|
||||
return "/tmp/fn-4640-test/.fusion";
|
||||
}
|
||||
getDatabase() {
|
||||
return {
|
||||
exec: vi.fn(),
|
||||
prepare: vi.fn().mockReturnValue({
|
||||
run: vi.fn().mockReturnValue({ changes: 0 }),
|
||||
get: vi.fn(),
|
||||
all: vi.fn().mockReturnValue([]),
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function mockRun() {
|
||||
|
||||
Reference in New Issue
Block a user