diff --git a/client/src/pages/OAuthAuthorizePage.test.tsx b/client/src/pages/OAuthAuthorizePage.test.tsx index fa84f016d..69a22f629 100644 --- a/client/src/pages/OAuthAuthorizePage.test.tsx +++ b/client/src/pages/OAuthAuthorizePage.test.tsx @@ -8,6 +8,12 @@ import { resetAllStores, seedStore } from '../../tests/helpers/store'; import { buildUser } from '../../tests/helpers/factories'; import OAuthAuthorizePage from './OAuthAuthorizePage'; +// The consent page reloads the user on mount, and loadUser registers the +// background sync triggers: a 30 s heartbeat and window listeners that nothing +// here unregisters, so they outlive the test and can fire, and log, while the +// file's worker shuts down. Nothing here is about sync. +vi.mock('../sync/syncTriggers', () => ({ registerSyncTriggers: vi.fn(), unregisterSyncTriggers: vi.fn() })); + // Default OAuth query params const DEFAULT_SEARCH = '?client_id=test-client&redirect_uri=http%3A%2F%2Flocalhost%3A4000%2Fcallback&scope=trips%3Aread&state=abc&code_challenge=challenge&code_challenge_method=S256'; diff --git a/client/src/pages/dashboard/useDashboard.test.tsx b/client/src/pages/dashboard/useDashboard.test.tsx index 6031b7d35..f3e2d44c8 100644 --- a/client/src/pages/dashboard/useDashboard.test.tsx +++ b/client/src/pages/dashboard/useDashboard.test.tsx @@ -11,6 +11,12 @@ import { useAuthStore } from '../../store/authStore'; import { useDashboard } from './useDashboard'; import type { DashboardTrip } from './dashboardModel'; +// Retrying reloads the user, and loadUser registers the background sync +// triggers: a 30 s heartbeat and window listeners that nothing here +// unregisters, so they outlive the test and can fire, and log, while the +// file's worker shuts down. Nothing here is about sync. +vi.mock('../../sync/syncTriggers', () => ({ registerSyncTriggers: vi.fn(), unregisterSyncTriggers: vi.fn() })); + // FE-HOOK-DASH-001 onwards const PARIS = buildTrip({ id: 101, title: 'Paris Adventure', start_date: '2026-07-01', end_date: '2026-07-10' });