From c052ddc5af2c1adb695cc7050b3bb4219eaa7f48 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Sun, 7 Jun 2026 00:03:46 +0200 Subject: [PATCH] test(web): widen findBy timeout for the lazy/portaled narrow-drawer detail test (#44) Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/objects/objects-page.test.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); });