From 7053444ca5e4803f8db14ebf392d5273999cf150 Mon Sep 17 00:00:00 2001 From: c9 <3124495484@qq.com> Date: Thu, 10 Sep 2026 14:36:36 +0800 Subject: [PATCH] fix(desktop): keep migrate dialog out of App tests The trampoline modal aria-hides the shell. Dismiss it in the shared Vitest setup so App integration queries can still see landmarks. --- tests/setupTests.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/setupTests.ts b/tests/setupTests.ts index 0ea499e5e..41d5038c3 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();