Testing
Bug fixes and features should always come with tests. If you want a visual representation of the test coverage of your code run yarn test:coverage.
Testing Tools
Unit - test both frontend code in isolation
E2E - to test the full stack completely on critical flows
When selecting dom elements use
data-testid
instead of using a class or id.
Testing Ui Business Logic
Separate the business logic from the view as much as possible. Create hooks, helpers & reducers to utilize this logic from the ui and test that code in isolation from it's ui.
Unit Testing
This is an example of how we structure our unit tests.
Hook Testing
This is an example of how we structure our hook tests
Last updated