Add Playwright e2e smoke and /api/subscribe verify check#63
Merged
lwwmanning merged 1 commit intomainfrom May 4, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Will Manning <will@willmanning.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔦 Lighthouse audit
Run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Playwright browser smoke suite (Chromium desktop + WebKit-iPhone-13 mobile) plus a new
/api/subscribeassertion inscripts/verify.ts. Together they cover the rendering and behavioral surface that HTTP-only and Lighthouse audits can't see.Playwright surface (
tests/smoke.spec.ts, 8 tests × 2 projects):home— hero copy text visible (overlay),<title>matches,<canvas>attaches to the DOM after hydration (skipped automatically when the browser doesn't support WebGL — headless WebKit on Linux often doesn't, Chromium has SwiftShader fallback so it runs there).blog index— links to a published post (seed slug discovered atbeforeAllfrom the rendered/blogHTML; entire describe skipped if no published posts).blog post—<h1>visible, andfigure[data-rehype-pretty-code-figure]with[data-line]children (asserts the rehype plugin actually tokenized the code block, not a fallback<pre>).mobile layout— runs at iPhone-13 viewport in themobileproject and at 375×812 in thedesktopproject; assertsscrollWidth ≤ clientWidthon/and/blog/<seed>(no horizontal-scroll regressions).Verify check (
scripts/verify.ts → checkSubscribe()):/api/subscribewith a synthetic email; asserts the route returns503 { error: "Subscription service is not configured" }whenRESEND_API_KEYis unset.new Resend(...)from inside the request handler to module scope, or removes the env-gate. Both would change the failure mode (build-time crash or 5xx at runtime).RESEND_API_KEYis set in the verify shell, rather than calling the real Resend API.CI integration (
.github/workflows/ci.yml):Verify endpointsandStop server (always).@playwright/testversion pinned inpackage.json— invalidates on bumps, hits otherwise. Even on a cache hit, system deps (apt) install separately (~10s vs ~3min for the full install).playwright-report/as an artifact (7-day retention) so trace files are recoverable.Other
package.json— addstest:e2eandtest:e2e:installscripts (mirroring the existinglighthouseandverifyscript style)..gitignore— adds/playwright-report/,/playwright/.cache/,/test-results/.Local verification
Test plan
Lint, build, verifyjob runs the full chain end-to-end, including Playwright on bothdesktopandmobileprojects)desktop(Chromium) and skips onmobile(iPhone 13 / WebKit) without failing the suite/or/blog/<slug>new Resend(...)to module scope locally fails the verify suite at the new/api/subscribestep (or fails the build, depending on the move)🤖 Generated with Claude Code