Testing
The template uses three complementary testing layers.
Unit and interaction tests (Vitest + Storybook)
Section titled “Unit and interaction tests (Vitest + Storybook)”Interaction tests run inside Storybook via @storybook/addon-vitest. They test component behaviour using Testing Library:
pnpm test:storybookUnit tests run with Vitest directly:
pnpm testUser flow tests (Cypress)
Section titled “User flow tests (Cypress)”End-to-end tests run against the smoke-test app using Cypress:
pnpm test:cypressThe app is served from app/main.tsx and exercises the full component integration.
Visual regression (Chromatic)
Section titled “Visual regression (Chromatic)”Chromatic captures and compares component screenshots on every PR. It is triggered automatically in CI via the test workflow.
Coverage
Section titled “Coverage”Coverage is collected from Storybook interaction tests using @storybook/addon-coverage. The threshold is enforced in CI via Codecov.