Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(chat): provide database snapshot mock for thread context

ylliuuu669b5fe3b9f0ec
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServerThreadContext.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServerThreadContext.test.ts
index 532851b6f1..0570c0125d 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServerThreadContext.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServerThreadContext.test.ts
@@ -8,7 +8,7 @@ vi.mock('../chatMigrationReceipts.js', () => ({ chatMigrationReceipts: () => ({
vi.mock('electron', () => ({ app: { isPackaged: false, getPath: () => '/isolated' } }));
vi.mock('node:fs', () => ({ existsSync: () => true, readFileSync: () => '{"baseUrl":"http://127.0.0.1:3018","auth":"cindy"}' }));
vi.mock('../botGroupChatService.js', () => ({ readPersistedReplyText: vi.fn() }));
-vi.mock('../../localDb/client/current.js', () => ({ getDbClient: () => ({ drizzle: {
+vi.mock('../../localDb/client/current.js', () => ({ getCurrentDbClientSnapshot: () => null, getDbClient: () => ({ drizzle: {
select: () => ({ from: () => ({ where: () => Object.assign(Promise.resolve(fixture.profiles), { limit: async () => [{ id: 'existing-local-group' }] }) }) }),
insert: () => ({ values: () => ({ onConflictDoNothing: async () => undefined }) }),
} }) }));