diff --git a/web/src/objects/objects-page.test.tsx b/web/src/objects/objects-page.test.tsx index d753d2b..0b92a05 100644 --- a/web/src/objects/objects-page.test.tsx +++ b/web/src/objects/objects-page.test.tsx @@ -67,9 +67,13 @@ test("narrow: detail renders inside a portaled drawer", async () => { renderApp(tree(), { route: "/objects" }); await userEvent.click(await screen.findByText("Amphora")); - // The drawer popup is portaled to document.body. + // The drawer popup is portaled to document.body. The narrow path lazy-loads the + // drawer chunk (Suspense) + mounts the Base UI Drawer + fetches the object, so the + // first query needs a wider window than the 1000ms findBy default (avoids a flake). const body = within(document.body); - expect(await body.findByRole("heading", { name: "Amphora" })).toBeInTheDocument(); + expect( + await body.findByRole("heading", { name: "Amphora" }, { timeout: 5000 }), + ).toBeInTheDocument(); expect(body.getByRole("button", { name: /close detail/i })).toBeInTheDocument(); });