Skip to content

test(web): component tests (jsdom+RTL) + run web tests in CI#15

Merged
pstaylor-patrick merged 1 commit into
mainfrom
test/web-components
May 24, 2026
Merged

test(web): component tests (jsdom+RTL) + run web tests in CI#15
pstaylor-patrick merged 1 commit into
mainfrom
test/web-components

Conversation

@pstaylor-patrick

Copy link
Copy Markdown
Collaborator

What this PR does

Adds behavior-focused React component tests (jsdom + Testing Library) and runs the web tests in CI.

Component coverage went from 0% (unmeasured) → ~95%; overall web coverage 92.6%.

Tests (assert our behavior, not the framework)

Boundaries (fetch, auth-client, router) are stubbed; assertions check real component behavior:

  • AuthForm: email+password sign-in calls signIn.email and routes to /dashboard; a failure surfaces the server error and does not navigate; signup calls signUp.email; the passkey button calls signIn.passkey.
  • Dashboard/DomainCard: register POSTs and renders the card; the "already claimed" error renders; edit-in-place PUTs and shows the new destination; remove DELETEs and the card disappears; "Add a passkey" calls addPasskey and confirms.

CI

New Web checks job: typecheck + the coverage-gated unit + integration + component suite against a Postgres service container (integration tests hit a real DB). Playwright e2e stays local (browser-heavy). Previously only Go ran in hosted CI.

Bona fide (audited)

Mutation-tested: breaking the error-surfacing in Dashboard makes the "already claimed" test go red; restored → green.

🤖 Generated with Claude Code

Component tests (jsdom + Testing Library), asserting OUR component behavior
with fetch/auth-client/router stubbed at the boundary (not "React renders"):
- AuthForm: email+password sign-in calls signIn.email and routes; failure
  surfaces the server error and does NOT navigate; signup calls signUp.email;
  passkey button calls signIn.passkey.
- Dashboard/DomainCard: register POSTs and renders the card; "already claimed"
  error renders; edit-in-place PUTs and shows the new destination; remove
  DELETEs and the card disappears; "Add a passkey" calls addPasskey + confirms.

CI: new "Web checks" job runs typecheck + the coverage-gated unit/integration/
component suite against a Postgres service (integration tests hit a real DB).
Playwright e2e stays local (browser-heavy).

Coverage: components 0% → ~95%; overall web 92.6%. Audited bona fide: breaking
the error-surfacing makes the "already claimed" test go red.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pstaylor-patrick pstaylor-patrick merged commit 1024f08 into main May 24, 2026
6 checks passed
@pstaylor-patrick pstaylor-patrick deleted the test/web-components branch May 24, 2026 21:43
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