20 lines
890 B
TypeScript
20 lines
890 B
TypeScript
import "@testing-library/jest-dom/vitest";
|
|
import { cleanup, configure } from "@testing-library/react";
|
|
import { afterEach, vi } from "vitest";
|
|
import { usePreferences } from "../src/state/preferences";
|
|
|
|
afterEach(() => {
|
|
cleanup();
|
|
// The board remembers what was seen per location (CR-008); start each test fresh.
|
|
if (typeof localStorage !== "undefined") localStorage.clear();
|
|
// One-time tips (the skill point pop-up among them) are shown again in each test.
|
|
usePreferences.setState({ dismissedTips: [] });
|
|
});
|
|
|
|
// findBy*/waitFor default to 1 s, which a busy parallel run can exceed; wait up to 3 s.
|
|
configure({ asyncUtilTimeout: 3000 });
|
|
|
|
// PixiJS needs WebGL, which jsdom lacks. Component tests use a stand-in canvas;
|
|
// the map's logic (projection, camera, scene, hit-testing) is unit-tested directly.
|
|
vi.mock("../src/map/MapCanvas", () => import("./map-canvas-double"));
|