faency icon indicating copy to clipboard operation
faency copied to clipboard

[RFC] Write tests for existing components

Open seedy opened this issue 4 years ago • 1 comments

Goals

  • improve quality of components
  • secure PRs and review with tests
  • avoid regression

Background

What we know

  • testing components with @testing-library

What Radix-UI does

  • writes "integration" tests for each of its components (ex)
  • check accessibility violations with axe-jest

What's possible with Storybook

Storybook allows writing tests for stories instead of components.

Chromatic automates testing visual changes

https://www.chromatic.com/docs/

Proposals

  • Test components with testing-library
  • Add axe-jest to check for accessibility violations
  • Write integration tests for related components, when it makes sense
  • See if it's worth adding storybook integrations

seedy avatar Jan 19 '22 09:01 seedy

  • We should test components not extending radix primitives
  • Testing accessibility is the most relevant part
  • Testing interactions with component
  • Avoid testing styles as it's redundant with stitches tests

seedy avatar Feb 15 '22 14:02 seedy