diff --git a/tests/setupTests.ts b/tests/setupTests.ts index 0ea499e5..41d5038c 100644 --- a/tests/setupTests.ts +++ b/tests/setupTests.ts @@ -1,8 +1,9 @@ import "@testing-library/jest-dom"; -import { afterAll, afterEach, beforeAll, vi } from "vitest"; +import { afterAll, afterEach, beforeAll, beforeEach, vi } from "vitest"; import { cleanup } from "@testing-library/react"; import i18n from "i18next"; import { initReactI18next } from "react-i18next"; +import { ELECTRON_MIGRATE_DISMISSED_KEY } from "@/lib/electronMigrate"; import { server } from "./msw/server"; import { resetProviderState } from "./msw/state"; import "./msw/tauriMocks"; @@ -22,6 +23,12 @@ beforeAll(async () => { }); }); +beforeEach(() => { + // The migrate dialog is a top-layer modal. Leave it dismissed unless a test + // explicitly clears this key, or App integration queries cannot see the shell. + window.localStorage.setItem(ELECTRON_MIGRATE_DISMISSED_KEY, "1"); +}); + afterEach(() => { cleanup(); window.localStorage.clear();