mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
test(e2e): expect a fresh account to reach onboarding, not billing
The registration spec asserted that a brand new account lands on /settings, which was true only because registering left trialEndsAt empty. It is now filled at signup, so the account has billing access and the dashboard lets it through to the onboarding wizard. That redirect is the done condition of the cardless trial, so the spec should hold it.
This commit is contained in:
@@ -63,13 +63,15 @@ test('a new account can be registered with the invite code and then signed in',
|
|||||||
await page.getByLabel('Password').fill(E2E_PASSWORD);
|
await page.getByLabel('Password').fill(E2E_PASSWORD);
|
||||||
await page.getByRole('button', { name: 'Sign in' }).click();
|
await page.getByRole('button', { name: 'Sign in' }).click();
|
||||||
|
|
||||||
// /settings, not /onboarding, and that is the real product behaviour rather
|
// /onboarding rather than /settings, which is the whole point of the cardless
|
||||||
// than a test artefact: POST /api/auth/register does not set `trialEndsAt`, so
|
// trial: registration grants the trial (here at signup, because SMTP is unset
|
||||||
// with OPENFRAME_ENABLE_STRIPE on a brand new account has no billing access,
|
// and there is no verification step to hang it on), so
|
||||||
// and requireBillingAccessOrRedirect() on /dashboard sends it to billing
|
// requireBillingAccessOrRedirect() on /dashboard lets the account through to
|
||||||
// before it ever sees the onboarding wizard.
|
// the wizard instead of parking it on billing.
|
||||||
await expect(page).toHaveURL(/\/settings$/);
|
await expect(page).toHaveURL(/\/onboarding$/);
|
||||||
await expect(page.getByRole('heading', { name: 'Settings', level: 1 })).toBeVisible();
|
await expect(
|
||||||
|
page.getByRole('heading', { name: 'Welcome to OpenFrame, Freshly!', level: 2 })
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
// The Seed fixture only tracks rows it created itself, so remove this one by
|
// The Seed fixture only tracks rows it created itself, so remove this one by
|
||||||
// hand rather than leaving it behind for the next run.
|
// hand rather than leaving it behind for the next run.
|
||||||
|
|||||||
Reference in New Issue
Block a user