Table of Contents generated with DocToc

Testing and validation

  • Add a colocated .test.tsx file for new components and changed behavior.
  • Use Vitest and Testing Library to test behavior visible to users. Prefer accessible queries and user interactions over implementation details.
  • Cover relevant loading, error, empty, and success states as well as important interactions.
  • Do not test React, Chakra UI, React Router, or other third-party internals.
  • Keep tests deterministic and restore mocks between tests.
  • Before finishing a change, run pnpm lint, pnpm test, and pnpm build. Run pnpm format when source formatting changes.