Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.29 KB

File metadata and controls

31 lines (19 loc) · 1.29 KB

CONTRIBUTOR-DOCS / Contributor guides / 2nd gen testing

2nd gen testing

In this doc

Overview

2nd gen components use three types of tests: Storybook play functions for interaction tests, Playwright for accessibility tests, and visual regression testing through stories. The full testing guide — including file structure, test patterns, assertion conventions, accessibility testing, coverage thresholds, flaky test prevention, and more — lives in the Testing guide.

Where to put tests

  • Keep docs stories in 2nd-gen/packages/swc/components/<component>/stories/<component>.stories.ts.
  • Add test stories in 2nd-gen/packages/swc/components/<component>/test/<component>.test.ts.
  • Add accessibility tests in 2nd-gen/packages/swc/components/<component>/test/<component>.a11y.spec.ts.
  • Reuse the base stories and metadata from the main doc stories file.
  • Test stories run in development Storybook only and are excluded from storybook:build.