From 941dabdc975c310ef5862e572cc62b5683efe1ef Mon Sep 17 00:00:00 2001 From: senke Date: Sat, 18 Apr 2026 20:19:33 +0200 Subject: [PATCH] fix(e2e): accept login-form as page readiness marker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 31-auth-sessions:36 (Refresh token expiré) calls navigateTo('/dashboard') expecting the auth guard to redirect to /login. The rc1-day2 widening accepted `main / [role=main] / app-sidebar / data-page-root` — none of which render on /login. Result: 20s timeout on a test that's actually working (the redirect happens, the helper just doesn't recognise the destination as "rendered"). Extend the accepted set with `[data-testid="login-form"]`, present on LoginPage.tsx since v1.0.x. The login page was the only authenticated-redirect destination not covered. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/e2e/helpers.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/e2e/helpers.ts b/tests/e2e/helpers.ts index 30add2d06..42a8773fc 100644 --- a/tests/e2e/helpers.ts +++ b/tests/e2e/helpers.ts @@ -153,12 +153,16 @@ export async function navigateTo(page: Page, path: string): Promise { // networkidle can legitimately timeout on pages with websockets/polling — not a test failure }); // App must render some substantive root content. v1.0.7-rc1-day2: - // widened from `main, [role="main"]` to also accept the app sidebar - // (rendered on every authenticated route, and stable against layout - // refactors that may or may not use semantic
) and any - // element marked `data-page-root` for explicit opt-in pages. + // widened from `main, [role="main"]` to also accept: + // * the app sidebar (rendered on every authenticated route) + // * `data-page-root` (explicit opt-in) + // * the login form (for navigations that are expected to + // redirect to /login — token-expiry tests, unauthenticated + // probes) + // Pages that render none of these are still treated as broken and + // fail at 20s. await page.locator( - 'main, [role="main"], [data-testid="app-sidebar"], [data-page-root]', + 'main, [role="main"], [data-testid="app-sidebar"], [data-page-root], [data-testid="login-form"]', ).first().waitFor({ state: 'visible', timeout: 20_000,