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:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user