diff --git a/apps/desktop/src/components/assistant-ui/thread/status.test.tsx b/apps/desktop/src/components/assistant-ui/thread/status.test.tsx index e51f39313a..51604b4dc4 100644 --- a/apps/desktop/src/components/assistant-ui/thread/status.test.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/status.test.tsx @@ -19,6 +19,10 @@ describe('ResponseLoadingIndicator timer', () => { beforeEach(() => { vi.useFakeTimers() vi.setSystemTime(new Date('2026-01-01T00:00:00.000Z')) + // useViewedInterval gates ticking on document focus + visibility; jsdom's + // hasFocus() is unreliable across runners, so pin it (same as the + // background-sync backstop tests). + vi.spyOn(document, 'hasFocus').mockReturnValue(true) __resetElapsedTimerRegistryForTests() }) @@ -27,6 +31,7 @@ describe('ResponseLoadingIndicator timer', () => { $activeSessionId.set(null) $turnStartedAt.set(null) __resetElapsedTimerRegistryForTests() + vi.restoreAllMocks() vi.useRealTimers() })