Skip to content

test(e2e): mocked-contract Playwright gate for the ClaimPage conversion journey#213

Merged
mastermanas805 merged 1 commit into
mainfrom
test/claim-ui-e2e
Jun 8, 2026
Merged

test(e2e): mocked-contract Playwright gate for the ClaimPage conversion journey#213
mastermanas805 merged 1 commit into
mainfrom
test/claim-ui-e2e

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

What

Adds e2e/claim-conversion.spec.ts — a browser-level Playwright spec for the ClaimPage conversion journey (anonymous → claimed → checkout money path), driven through the real /claim?t= SPA route + real src/api client, with the network mocked at the page.route() boundary.

Runs under the default mocked config (playwright.config.ts, VITE_NO_PROXY=1), so it executes on every web PR via e2e-pr-smoke's mocked path without minting real resources.

Why (the gap it fills)

Three layers already touch the claim flow; this spec fills the one gap between them and is scoped not to duplicate any:

Layer What it covers The gap
src/pages/ClaimPage.test.tsx (vitest) Component state machine Stubs the ../api module — the SPA→fetch wiring (URL/method/request body, response→error mapping in call()) is never exercised. A /claim rename or checkout-body rename would not red it.
e2e/live-claim-deploy.spec.ts (live cohort) Real api via request fixture (api-direct) Never renders ClaimPage in a browser; runs only on the scheduled/on-demand live suite.
e2e/auth-roundtrip.spec.ts Cookie-exchange seam Not the claim conversion UI.

This spec is the missing middle: real browser + real src/api client + mocked network, redding a PR if the SPA→api claim/checkout wiring breaks.

Coverage (10 tests)

  • Preview list rendered from the upgrade token (?t= decoded client-side)
  • Malformed-token dead-end (invalid-link state + pricing CTA)
  • Empty-email client guard (no POST /claim fired)
  • Email submit → POST /claim {jwt,email} → payment funnel (asserts the request body contract)
  • Live HH:MM:SS countdown derived from the resource TTL
  • Hobby / Pro checkout CTA → plan wiring + short_url redirect
  • Inline checkout-failure (502) keeps the user on the funnel, CTA re-enabled, no redirect
  • Claim error states: 409 already_claimed and account_exists → inline error, funnel does not mount

Gate

  • npm run gate green — tsc --noEmit + vite build (incl. scripts/prerender.mjs) + vitest run (1147 passed / 3 skipped).
  • New spec discovered by the default config (10 tests × 3 browsers) and 10/10 pass in mock mode (chromium).

No live-claim-deploy duplication. No real resources minted. No prod calls.

🤖 Generated with Claude Code

…on journey

Adds e2e/claim-conversion.spec.ts — a browser-level Playwright spec that drives
the REAL ClaimPage route (/claim?t=) + REAL src/api client with the network
mocked at the page.route() boundary, so it runs on every web PR (mocked config,
VITE_NO_PROXY=1) without minting real resources.

Fills the gap between the three existing claim layers without duplicating any:
  - ClaimPage.test.tsx (vitest) stubs the `../api` MODULE — never exercises the
    SPA→fetch wiring (URL/method/body, response→error mapping in call()).
  - live-claim-deploy.spec.ts drives the api-direct (request fixture), never
    renders ClaimPage, runs only on the scheduled/on-demand live suite.
  - auth-roundtrip.spec.ts covers the cookie-exchange seam, not claim UI.

Coverage (10 tests): preview rendered from the upgrade token; malformed-token
dead-end; empty-email client guard; email → POST /claim {jwt,email} → payment
funnel; live HH:MM:SS countdown from the resource TTL; Hobby/Pro checkout CTA
plan wiring + short_url redirect; inline checkout-failure (no redirect); and the
claim error states (409 already_claimed, account_exists → error, no funnel).

All 10 pass in mock mode (chromium). npm run gate green (tsc + build + 1147
vitest). No live-claim-deploy duplication; no real resources minted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

size-limit report 📦

Path Size
dist/assets/index-CgN1XV4b.js 161.99 KB (0%)
dist/assets/index-BsJUZYRr.css 6.13 KB (0%)

@mastermanas805 mastermanas805 merged commit c031fce into main Jun 8, 2026
19 checks passed
@mastermanas805 mastermanas805 deleted the test/claim-ui-e2e branch June 8, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant