feat: replace WTR with Storybook interaction tests via Vitest addon#10
Merged
cristinecula merged 2 commits intomainfrom Feb 4, 2026
Merged
feat: replace WTR with Storybook interaction tests via Vitest addon#10cristinecula merged 2 commits intomainfrom
cristinecula merged 2 commits intomainfrom
Conversation
Replace @web/test-runner with Vitest + @storybook/addon-vitest + Playwright browser mode for running interaction tests co-located with stories using play functions. Changes: - Add vitest.config.ts with storybookTest plugin and Playwright - Add .storybook/preview.js with shadow-dom-testing-library setup and autodocs source transform for clean code display - Add .storybook/vitest.setup.ts for project annotations - Add @storybook/addon-vitest to .storybook/main.js - Add play functions with step() to all 3 stories testing: default greeting, custom greeting, empty greeting, and click-to-increment counter behavior - Remove test/component.test.ts and web-test-runner.config.mjs - Remove @open-wc/testing, @types/mocha, @web/test-runner-playwright devDependencies - Add vitest, @vitest/browser, @vitest/browser-playwright, @playwright/test, @storybook/addon-vitest, shadow-dom-testing-library devDependencies
|
megheaiulian
approved these changes
Feb 4, 2026
github-actions bot
pushed a commit
that referenced
this pull request
Feb 4, 2026
## [1.3.0](v1.2.1...v1.3.0) (2026-02-04) ### Features * replace WTR with Storybook interaction tests via Vitest addon ([#10](#10)) ([3af42cc](3af42cc))
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
@web/test-runnerwith Vitest +@storybook/addon-vitest+ Playwright browser mode for running interaction tests co-located with storiesshadow-dom-testing-libraryfor idiomatic shadow DOM queries (findByShadowText,getByShadowRole, etc.)step()function to group interactions in the Storybook Interactions panelChanges
New files
vitest.config.ts— Vitest config withstorybookTestplugin, Playwright chromium browser provider.storybook/preview.js—shadow-dom-testing-librarysetup viabeforeEach+ autodocs sourcetransformfor clean code display.storybook/vitest.setup.ts—setProjectAnnotationsfor VitestModified files
.storybook/main.js— Added@storybook/addon-vitestaddonstories/component.stories.ts— Added play functions withstep()to all 3 stories (default greeting, custom greeting, empty greeting, click-to-increment)package.json— Updated test scripts to use Vitest, added new devDependencies, removed WTR depsRemoved files
test/component.test.ts— Replaced by story play functionsweb-test-runner.config.mjs— No longer neededTest commands
Pattern reference
This follows the same testing infrastructure established in cosmoz-command-menu PR #6.