test(auth): warm the Welcome import once so the first case cannot time out under load
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
//
|
//
|
||||||
// entryUrl snapshots window.location at IMPORT time, so the access-notice cases reset the module
|
// 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.
|
// 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 { render, screen, fireEvent, cleanup, act } from "@testing-library/react";
|
||||||
import type { VerifyEntry } from "../lib/useVerifyEntry";
|
import type { VerifyEntry } from "../lib/useVerifyEntry";
|
||||||
|
|
||||||
@@ -18,6 +18,13 @@ const noVerify: VerifyEntry = {
|
|||||||
dismiss: () => {},
|
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(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
vi.resetModules();
|
vi.resetModules();
|
||||||
|
|||||||
Reference in New Issue
Block a user