From 2ebb5ea9cf3a50f9f3702016c4a736c980430e8b Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Tue, 3 Nov 2026 07:31:50 +0100 Subject: [PATCH] test: run the handoff wipes on the local store --- lib/offline/__tests__/handoff-wipes.test.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/offline/__tests__/handoff-wipes.test.ts b/lib/offline/__tests__/handoff-wipes.test.ts index 84c58ba08..534a060c8 100644 --- a/lib/offline/__tests__/handoff-wipes.test.ts +++ b/lib/offline/__tests__/handoff-wipes.test.ts @@ -5,9 +5,8 @@ import { usePolicyStore } from '@/stores/policy-store'; import { DEFAULT_ORGANISATION_POLICY } from '@/lib/admin/organisation-policy'; import { handOffFiles, pendingHandoffs } from '@/lib/launch-handoff'; import { disableOffline, enforcePolicy, wipeEverything } from '../offline-mode'; -import { forgetIndexes } from '../cache'; -import { forgetDeviceKey } from '../crypto'; -import { allowOfflineDbCreation, deleteOfflineDb } from '../db'; +import { setStoreBackend } from '@/lib/store/client/api'; +import { InProcessStore } from '@/lib/store/__tests__/helpers/in-process-store'; import { useOfflineStore, writeEnabled } from '../state'; // Offline mode's wipes take what was on its way into an account along. @@ -18,10 +17,7 @@ function waiting() { } beforeEach(async () => { - forgetIndexes(); - forgetDeviceKey(); - await deleteOfflineDb(); - allowOfflineDbCreation(); + setStoreBackend(new InProcessStore()); localStorage.clear(); useOfflineStore.setState({ enabled: [], outbox: [], pendingChanges: 0, browserOffline: false, downServers: [], startedOffline: false }); usePolicyStore.setState({ loaded: true, subject: null, subjectPending: false, policy: { ...usePolicyStore.getState().policy, organisation: DEFAULT_ORGANISATION_POLICY } } as never); @@ -30,6 +26,7 @@ beforeEach(async () => { afterEach(async () => { await wipeEverything(); + setStoreBackend(null); }); describe('offline wipes and handoffs', () => {