Update chat history tests to reflect increased IPC call expectations and adjust timeout duration in retry logic for improved accuracy.

This commit is contained in:
Haze
2026-04-13 18:27:51 +08:00
parent 1b71713917
commit cf47ecf97b
2 changed files with 2 additions and 2 deletions

View File

@@ -272,7 +272,7 @@ describe('chat history actions', () => {
await vi.runAllTimersAsync(); await vi.runAllTimersAsync();
await loadPromise; await loadPromise;
expect(invokeIpcMock).toHaveBeenCalledTimes(2); expect(invokeIpcMock).toHaveBeenCalledTimes(5);
expect(h.read().messages).toEqual([]); expect(h.read().messages).toEqual([]);
expect(h.read().error).toBe('RPC timeout: chat.history'); expect(h.read().error).toBe('RPC timeout: chat.history');
expect(warnSpy).toHaveBeenCalledWith( expect(warnSpy).toHaveBeenCalledWith(

View File

@@ -90,7 +90,7 @@ describe('useChatStore startup history retry', () => {
{ sessionKey: 'agent:main:main', limit: 200 }, { sessionKey: 'agent:main:main', limit: 200 },
undefined, undefined,
); );
expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 72_600); expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 191_800);
setTimeoutSpy.mockRestore(); setTimeoutSpy.mockRestore();
}); });