diff --git a/src/services/acp/__tests__/agent.test.ts b/src/services/acp/__tests__/agent.test.ts index 6b9b33721..9a1156ce6 100644 --- a/src/services/acp/__tests__/agent.test.ts +++ b/src/services/acp/__tests__/agent.test.ts @@ -30,9 +30,13 @@ mock.module('src/utils/config.ts', () => ({ enableConfigs: mock(() => {}), })) +const mockSwitchSession = mock(() => {}) + mock.module('../../../bootstrap/state.js', () => ({ setOriginalCwd: mock(() => {}), addSlowOperation: mock(() => {}), + switchSession: mockSwitchSession, + getSessionProjectDir: mock(() => null), })) const mockGetDefaultAppState = mock(() => ({ @@ -87,9 +91,9 @@ const mockResolveSessionFilePath = mock(async () => ({ projectPath: '/tmp', fileSize: 100, })) -mockModulePreservingExports('../../../utils/sessionStoragePortable.js', { +mock.module('../../../utils/sessionStoragePortable.js', () => ({ resolveSessionFilePath: mockResolveSessionFilePath, -}) +})) const mockGetMainLoopModel = mock(() => 'claude-sonnet-4-6') @@ -755,7 +759,6 @@ describe('AcpAgent', () => { expect(commit.input).toEqual({ hint: '[message]' }) }) }) - }) describe('sessionId alignment with global state', () => { test('newSession calls switchSession with the generated sessionId', async () => {