mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user