Skip to content

test(ui): Add snapshot tests for SignInStartView#8658

Draft
alexcarpenter wants to merge 3 commits into
prop-driven-factor-twofrom
sign-in-start-cleanup
Draft

test(ui): Add snapshot tests for SignInStartView#8658
alexcarpenter wants to merge 3 commits into
prop-driven-factor-twofrom
sign-in-start-cleanup

Conversation

@alexcarpenter
Copy link
Copy Markdown
Member

Summary

  • Adds 8 snapshot tests for SignInStartView, which is already a pure-props component (no context hooks).
  • Tests cover: loading screen, email form, password field, combined flow, waitlist mode, restricted mode, card error, and passkey button.
  • Includes a stubFormControl helper for creating mock FormControlState objects in snapshot tests.
  • No refactoring of the reducer/hook — the existing effects-as-data pattern in signInStartMachine.ts is already well-tested (30+ test cases) and makes the reducer fully testable as a pure function. Removing it would regress testability.

Stacked on #8657.

Test plan

  • All 1910 UI package tests pass (0 failures)
  • All 257 SignIn-specific tests pass
  • New snapshot tests render every SignInStartView variant without full Clerk runtime

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 27, 2026 12:21am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

🦋 Changeset detected

Latest commit: fff994b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

alexcarpenter and others added 3 commits May 26, 2026 20:15
SignInStartView is already prop-driven (no context hooks). Adds 8
snapshot tests covering loading, email form, password field, combined
flow, waitlist, restricted mode, card error, and passkey button states.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reducer now returns just state, not { state, effects }. Side-effect
decisions extracted into pure testable functions (routeSignInStatus,
classifySubmitError). Effect execution moved to async handlers in the
hook (handleSignInCreate, handleTicketFlow). Removed identifierValue
and passwordValue from reducer state — form controls own their values
directly. Updated tests to verify pure functions independently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant