test: run Storybook stories as Vitest browser tests#423
Open
ryanmagoon wants to merge 3 commits into
Open
Conversation
…don-vitest Adds @storybook/addon-vitest with Playwright Chromium browser mode as a second Vitest project in packages/ui. Every story now runs as a render smoke test and play functions execute as blocking assertions (418 tests, 134 from stories). Version alignments required by the addon: - storybook packages 10.4/10.2 -> 10.5 (addon needs matching core exports) - vitest 4.0 -> 4.1 workspace-wide (@vitest/browser-playwright requires it) - pnpm dedupe react/react-dom (re-resolution split the graph into 19.1/19.2, breaking hooks in unit tests with a nested react-dom copy) Closes #422 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The toolbar fetches its session endpoint on every story mount, which logged a warning per test in CI. Storybook dev and Chromatic rendering are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Story tests run in Vitest browser mode and need the browser binary on the runner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Closes #422
What
Adds
@storybook/addon-vitesttopackages/uiso every story runs as a component test in Vitest browser mode (headless Chromium via Playwright):playfunctions are now blocking CI assertions — previously they only ran when a story was viewed manually or incidentally inside Chromatic (which is non-blocking).unitVitest project.pnpm --filter @gamelord/ui testnow runs both projects: 418 tests, 37 files, ~6s.Supporting changes
storybook/internal/channels).@vitest/browser-playwrightrequires it.pnpm dedupe react react-dom— the dependency re-resolution had split the graph into react 19.1/19.2 with a nestedreact-domunder@testing-library/react, which broke hooks in unit tests.Verification
pnpm test.pnpm lint,pnpm typecheck,pnpm format:checkall pass.No screenshots — test/CI infrastructure only, no visual changes.
🤖 Generated with Claude Code