Merge pull request 'fix: tests/setup/navigate.ts: bare 500ms timeout after pushState is fragile under CPU pressure (#390)' (#417) from fix/issue-390 into master

This commit is contained in:
johba 2026-03-03 02:13:27 +01:00
commit afcf13bc84

View file

@ -12,6 +12,9 @@ export async function navigateSPA(page: Page, path: string): Promise<void> {
window.history.pushState({}, '', p);
window.dispatchEvent(new PopStateEvent('popstate'));
}, path);
// Give Vue Router time to resolve the route and render
await page.waitForTimeout(500);
// waitForURL would resolve immediately (pushState already updated the URL
// synchronously), so wait for networkidle instead: that fires once Vue Router
// has processed the popstate event, mounted the new view, and any route-
// triggered data fetches have settled.
await page.waitForLoadState('networkidle', { timeout: 10_000 });
}