For a component library to be stable, it must be testable and tested.
jest..spec.tsx extension (for example, ComponentName.spec.tsx).ComponentName.uni.driver.ts.Storybook: A playground for displaying React components with a navigation sidebar.Sled: A tool for visual testing in Storybook.Q: How do I create visual test files?
A: Create a new file MyComponent/test/MyComponent.visual.tsx:
Q: What do I test in visual tests?
A: Styling variations in different states (for example, props like: size, skin, error message...).
Q: How do I test interactions in visual tests?
A: For asynchronous actions (for example, waiting for a tooltip to appear), use Sled e2e tests.
Warning: Interactions that aren't immediate (like animations) can cause flaky tests.
Q: How to run visual tests locally?
or
Q: How can I update a baseline if I see a diff?
A: There are two ways you can accept a baseline.
or
Q: How can I debug a component that has been rendered into a snapshot?
A: Start Storybook testing environment to see your snapshots live:
or
Once the local server is running, open it in your browser and navigate to the component you want to debug. Then, in code, find the snapshot-generating test and work with it to find a solution to your problem.
Puppeteer in Chrome..sled.spec.ts extension (for example, ComponentName.sled.spec.ts), located in packages/wix-design-system/sled/tests/__storybook-e2e-tests__/.or
or
In watch mode, use jest's interactive mode by pressing p and typing the name of the test.
or
or
Last updated: 26 October 2026