test(e2e): mail-sink helper + un-fixme reset/magic-link/change-email (BUNYIP-150) #220
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-150-e2e-mail-sink"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Un-fixme the three email-driven E2E specs by reading their token-links out of the staging Mailpit sink. Part 3 (final) of BUNYIP-150.
How
e2e/lib/mail-sink.ts:clearMailbox()+waitForLink(toAddress, linkRe)over Mailpit's HTTP API (/api/v1/search?query=to:<addr>then/api/v1/message/<id>), with the basicAuth credentials parsed out ofE2E_MAIL_SINK_URLinto anAuthorizationheader. Filters by the link pattern so the async welcome mail to the same address is ignored.e2e/lib/accounts.ts: register a throwaway, run-tagged account viaPOST /v1/auth/register(no email confirmation gate), and self-delete viaDELETE /v1/users/me.fill()flakiness, and no shared-storageState risk):auth/magic-link.spec.ts: request/magic-link, read the token, verify on a fresh context, assert it reads/v1/auth/memberships.auth/password-reset.spec.ts: request/password-reset, read the token, confirm a new password, assert the new password logs in.account/change-email.spec.ts: request the change, read the verification link sent to the NEW address, confirm the token, assert the new email. PinsstorageState: undefinedso it can never mutate the shared login.env.tsgains optionalmailSinkURL;.env.example,e2e/README.md, anddev-docs/e2e.mddocument it;e2e.ymlresolvesE2E_MAIL_SINK_URLto the staging secret on staging and empty on production.Each spec
test.skips whenenv.mailSinkURLis unset, so production and an unprovisioned staging skip these rather than fail. Disposable accounts self-delete in afinallyand carry the run tag.Dependencies / merge order
SmtpTls::None) on main + rebuilt to:latest.bunyip-mailpitstaging deployment + SMTP repoint) deployed on c-01.E2E_STAGING_MAIL_SINK_URL.Until the secret is set the three specs SKIP, so this PR is safe to merge at any point without breaking CI; coverage activates once the sink is live.
Verification
tsc --noEmitclean.playwright test --list: the three specs now collect as real tests (no longertest.fixme); 18 tests total.Follow-ups (not blocking)
auth/signup.spec.tsremainstest.fixme(separate follow-up under BUNYIP-150's umbrella).🤖 Generated with Claude Code