From dc00b55feb70dc146f64843628d0e2da6c3a37ee Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sat, 3 Oct 2026 21:53:06 +0200 Subject: [PATCH] test(auth): warm the Welcome import once so the first case cannot time out under load --- frontend/src/components/authCardStates.dom.test.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/authCardStates.dom.test.tsx b/frontend/src/components/authCardStates.dom.test.tsx index 59c37ade..c0e09e56 100644 --- a/frontend/src/components/authCardStates.dom.test.tsx +++ b/frontend/src/components/authCardStates.dom.test.tsx @@ -7,7 +7,7 @@ // // entryUrl snapshots window.location at IMPORT time, so the access-notice cases reset the module // registry and set the URL before importing — that is the behaviour under test, not a workaround. -import { describe, it, expect, afterEach, vi } from "vitest"; +import { describe, it, expect, afterEach, beforeAll, vi } from "vitest"; import { render, screen, fireEvent, cleanup, act } from "@testing-library/react"; import type { VerifyEntry } from "../lib/useVerifyEntry"; @@ -18,6 +18,13 @@ const noVerify: VerifyEntry = { dismiss: () => {}, }; +// Every case re-imports the whole Welcome tree after a module reset. The FIRST import also transforms +// it, which under the full suite's parallel load ran past the 5 s test timeout (E32 S2, gate flake). +// Transforms survive resetModules, so warming them once here leaves each case only the evaluation. +beforeAll(async () => { + await import("./Welcome"); +}, 60_000); + afterEach(() => { cleanup(); vi.resetModules();