test(web): widen findBy timeout for the lazy/portaled narrow-drawer detail test (#44)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 00:03:46 +02:00
parent e7b0f65686
commit c052ddc5af
+6 -2
View File
@@ -67,9 +67,13 @@ test("narrow: detail renders inside a portaled drawer", async () => {
renderApp(tree(), { route: "/objects" }); renderApp(tree(), { route: "/objects" });
await userEvent.click(await screen.findByText("Amphora")); 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); 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(); expect(body.getByRole("button", { name: /close detail/i })).toBeInTheDocument();
}); });