diff --git a/tests/setup/navigate.ts b/tests/setup/navigate.ts index 2e43b5b..c6cc6ab 100644 --- a/tests/setup/navigate.ts +++ b/tests/setup/navigate.ts @@ -12,6 +12,6 @@ export async function navigateSPA(page: Page, path: string): Promise { window.history.pushState({}, '', p); window.dispatchEvent(new PopStateEvent('popstate')); }, path); - // Give Vue Router time to resolve the route and render - await page.waitForTimeout(500); + // Wait for Vue Router to actually resolve the route (not a fixed delay) + await page.waitForURL((url) => url.pathname === path, { timeout: 10_000 }); }