Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(client): keep the login's background trip sync out of the push spec

Maurice395a7f41fee4
diff --git a/client/tests/unit/stores/authStore.push.test.ts b/client/tests/unit/stores/authStore.push.test.ts
index a97e6c4f6..686ae6cf6 100644
--- a/client/tests/unit/stores/authStore.push.test.ts
+++ b/client/tests/unit/stores/authStore.push.test.ts
@@ -25,6 +25,13 @@ vi.mock('../../../src/sync/syncTriggers', () => ({
unregisterSyncTriggers: vi.fn(),
}));
+// Login kicks off a full trip sync it does not wait for. Left real, that sync
+// can still be logging when the file's worker shuts down, and vitest reports
+// the cut-off console call as an unhandled error. Nothing here is about sync.
+vi.mock('../../../src/sync/tripSyncManager', () => ({
+ tripSyncManager: { syncAll: vi.fn(async () => {}) },
+}));
+
beforeEach(() => {
resetAllStores();
vi.clearAllMocks();