storybook-testing

Test Storybook 9/10 components with Vitest, play() interactions, and Chromatic TurboSnap.

217|20|Updated Dec 31, 2025
One-click install
npx skills add https://github.com/yonatangross/orchestkit --skill storybook-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: storybook-testing
Source: https://github.com/yonatangross/orchestkit/tree/main/plugins/ork/skills/storybook-testing
Command: npx skills add https://github.com/yonatangross/orchestkit --skill storybook-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing robust tests for your UI components within Storybook, ensuring visual consistency, interaction correctness, and accessibility compliance.

Core Features & Use Cases

  • Component Testing: Write interaction tests using play() functions and Vitest.
  • Visual Regression: Integrate Chromatic TurboSnap for efficient visual diffing.
  • Accessibility Audits: Automatically scan for WCAG violations with the a11y addon.
  • Use Case: When developing a new React component, use this Skill to write type-safe CSF3 stories, implement interaction tests for user flows, and set up Chromatic for visual regression testing in your CI pipeline.

Quick Start

Write a Storybook story for my Button component that tests the click handler, has variants for primary/secondary/danger, and generates documentation automatically.

Frequently Asked Questions about storybook-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Storybook interaction tests for a React component?

Storybook interaction tests use the `play()` function within CSF3 stories to simulate user flows. Vitest integration executes these functions to verify component behavior, ensuring your UI logic works correctly during frontend development.

What is the best way to set up visual regression testing in Storybook?

Visual regression testing in Storybook is best handled by integrating Chromatic TurboSnap. It provides efficient visual diffing to catch unintended UI changes, ensuring visual consistency across component updates in your CI pipeline.

Does Storybook support automated accessibility audits for UI components?

Yes, Storybook supports automated accessibility audits using the a11y addon. It automatically scans your components for WCAG violations, ensuring accessibility compliance directly within your development workflow.

Can I write typesafe CSF3 stories for my component variants?

Yes, you can write typesafe CSF3 stories using factory patterns. This approach ensures strict type checking for component props and variants, generating robust stories and automatic documentation for your UI components.

How do you isolate component dependencies when testing in Storybook?

You isolate component dependencies in Storybook using `sb.mock`. This feature allows you to mock external modules and data, ensuring tests remain focused purely on the component's internal logic without external interference.

Do I need Vitest to run component tests in Storybook 9/10?

Yes, Vitest integration is required to run component tests in Storybook 9/10. It acts as the underlying test runner for executing your `play()` interaction tests and validating component behavior.