CONTRIBUTOR-DOCS / Style guide / Testing guide
Beneath this doc
This guide explains how to write tests for 2nd-gen components. Good tests catch bugs before users see them, make sure components are accessible, document how components should work, and give you confidence when changing code.
We use three types of tests:
| Type | Tool | File pattern | What it covers |
|---|---|---|---|
| Interaction tests | Storybook play functions | *.test.ts |
Properties, slots, events, warnings |
| Accessibility tests | Playwright + aXe | *.a11y.spec.ts |
ARIA tree, WCAG compliance |
| Visual regression tests | Storybook + Chromatic | *.stories.ts |
Rendering across browsers and themes |