Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/ui-overlap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ async function mockDemoDashboard(page: Page) {
}

async function gotoHome(page: Page) {
await page.goto("/", { waitUntil: "domcontentloaded" });
// Pin mode=answer so GlobalSearchShell does not immediately router.replace()
// for a stored landing preference. That replace can briefly leave two mounted
// shells (and two header#search nodes), which trips Playwright strict mode.
await page.goto("/?mode=answer", { waitUntil: "domcontentloaded" });
// Wait until React settles on a single header. During client remount /
// hydration a second transient header#search can exist briefly and trip
// Playwright strict mode even though the stable tree has only one banner.
// Permanent double-render still fails toHaveCount(1).
const header = page.locator("header#search");
await expect(header).toHaveCount(1, { timeout: 30_000 });
await header.waitFor({ state: "visible", timeout: 30_000 });
Expand Down