test(e2e): smoke spec — app loads and OTC sign-in succeeds via Mailpit

The first end-to-end smoke spec, run live against the Tier-1 stack
(§22 M3-0 Task 7). Drives the §6.2 email OTC sign-in: loads the app,
requests a code, reads it from Mailpit, verifies it, and asserts the
verify returns ok:true and sets the rfc_session cookie.

Supporting harness fixes:
- Makefile: add .PHONY so `make e2e` actually runs (the e2e/ directory
  was shadowing the target, making it a no-op).
- mailpit.js: guard the per-message detail fetch (if !full.ok continue)
  and scan the plain-text part before HTML so the \d{6} match can't
  latch onto a stray number.
- spec uses a unique per-run email to avoid the per-email request
  cooldown (OTC_REQUEST_COOLDOWN_SECONDS) on re-runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-03 22:57:02 -07:00
parent 7d05125381
commit 539d063c22
4 changed files with 60 additions and 2 deletions
+2
View File
@@ -1,3 +1,5 @@
.PHONY: tier1-up tier1-down tier1-logs fe-unit e2e
tier1-up:
docker compose -f testing/docker-compose.yml up --build -d