Skip to content
SprecherEast
Issue 1317

feat: Passkey flows tested end to end, as a resident uses them

Back to our plan
Done
enhancementauthuxpriority: low

Problem

Each passkey step has its own tests, but nobody has walked the whole journey a resident takes: add a passkey, sign out, sign back in with it, lose it, and get back in by email. Until that passes, the feature stays off.

Proposed fix

  • Playwright tests with the browser's virtual authenticator (Chromium's WebAuthn support), on a phone-sized and a desktop-sized viewport:
    1. Sign in with email and password, add a passkey, sign out.
    2. Sign in with the passkey; /account shows the account; "keep me signed in" behaves as with a password.
    3. Cancel the browser prompt: nothing breaks, email and password still work.
    4. Remove the passkey; it no longer signs in.
    5. Lost device: with no passkey, forgot password gets the resident back in.
    6. A locked account can't sign in with its passkey.
  • The switch has to be on for the test server only, and the default e2e server can't do it: it is a production build on http://localhost, opens in a new tab, and record 0021's relying-party rule refuses that. See the first comment on this issue for the options.
  • An accessibility pass over both screens (keyboard only, screen reader names, axe).

Existing work compared

  • Searched: issues for end-to-end and account flows (#311 tested every account flow as a resident would, closed before passkeys existed); e2e/accounts.spec.ts.
  • Native: Playwright drives a virtual authenticator through Chromium; no package is added.
  • Our code: extends the existing accounts e2e set. New work, because passkeys didn't exist.

Acceptance criteria

  • Not done: Each journey above passes on both viewports.
  • Not done: The existing accounts e2e tests stay green with the switch on and off.
  • Not done: Keyboard-only and axe checks pass on /login and /account.
  • Not done: The epic's "Done when" lines are each checked against the result and noted on the epic.

Files likely touched

  • e2e/passkeys.spec.ts (new), e2e/support/ (a virtual authenticator helper), e2e/serve.mjs

Must not touch

  • src/** (a bug found here gets its own bug issue, linked)

Open questions

  • None.

Area

auth, ux

Priority

low


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab