diff --git a/tests/features/reference-feature/reference-page.test.tsx b/tests/features/reference-feature/reference-page.test.tsx index 43fe742c..861b5011 100644 --- a/tests/features/reference-feature/reference-page.test.tsx +++ b/tests/features/reference-feature/reference-page.test.tsx @@ -4,9 +4,15 @@ import { QueryClient, QueryClientProvider, } from "@tanstack/react-query"; -import { render, screen, waitFor } from "@testing-library/react"; +import { + configure, + getConfig, + render, + screen, + waitFor, +} from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { describe, expect, it, vi } from "vitest"; +import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; import { createDemoSessionAdapter } from "../../../src/adapters/auth/external-session-adapter.ts"; import type { AuthSessionPort } from "../../../src/application/ports/auth-session-port.ts"; @@ -122,6 +128,16 @@ function inputWith( } describe("reference feature page states", () => { + // Entering an installed route resolves the context route table and then a + // lazy page, and React holds each Suspense reveal for up to 300ms. That + // floor alone uses half of Testing Library's 1s findBy default, so a busy + // host misses it and reports a missing heading instead of a slow route. + // Keep the wider wait scoped to this file; the test timeout still catches + // a real hang. + const defaultAsyncUtilTimeout = getConfig().asyncUtilTimeout; + beforeAll(() => configure({ asyncUtilTimeout: 5_000 })); + afterAll(() => configure({ asyncUtilTimeout: defaultAsyncUtilTimeout })); + it("mounts list and detail keys under the installed governed namespace", async () => { expect(REFERENCE_RESOURCE_QUERY_NAMESPACE).toEqual({ namespaceId: "reference-resource",