From fe42c0836f180773e20ec1df39d090e8eb3f6c37 Mon Sep 17 00:00:00 2001 From: yusufipk Date: Sun, 26 Jul 2026 11:41:05 +0700 Subject: [PATCH] fix(test): stop anchoring the post-register URL assertion The login page derives callbackUrl from its own default when the parameter is absent, and on CI it arrives as /login?registered=true&callbackUrl=%2Fdashboard. Anchoring the pattern with $ made that a deterministic CI-only failure while the suite passed locally on every run, including with CI=1. What the register flow promises is the login page plus registered=true. The rest of the query string is not part of that contract, so the pattern now tolerates extra parameters in any order. The page snapshot that diagnosed this also turned up a product bug, recorded in the findings notes rather than fixed here: the success banner tells every new user to check their email for a verification link, including in the self-hosted default where SMTP is unset, email verification is off, and the account is already usable. --- tests/e2e/auth.spec.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/e2e/auth.spec.ts b/tests/e2e/auth.spec.ts index 5e166a3..93b413f 100644 --- a/tests/e2e/auth.spec.ts +++ b/tests/e2e/auth.spec.ts @@ -49,7 +49,14 @@ test('a new account can be registered with the invite code and then signed in', // SMTP is unset for the app under test, so isEmailVerificationEnabled() is // false and the account is auto-verified rather than parked on /verify-email. - await expect(page).toHaveURL(/\/login\?registered=true$/); + // + // Deliberately tolerant of extra query parameters rather than anchored with + // `$`. What the register flow promises is the login page plus `registered=true`; + // the rest of the query string is not part of that contract. On CI the login + // page arrives carrying `callbackUrl=%2Fdashboard`, which it derives from its + // own default in getSafeCallbackUrl(null), and an anchored pattern turned that + // into a deterministic CI-only failure while passing locally. + await expect(page).toHaveURL(/\/login\?(?:.*&)?registered=true(?:&|$)/); await expect(page.getByText('Account created successfully!')).toBeVisible(); await page.getByLabel('Email').fill(email);