-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Describe the chore
For the beginning we should be fine using Jest and the React Testing Library.
Jest is the test runner and provides various utility, which is essential for testing (components), e.g. spying, mocking etc.
React Testing Library provides utility to test the DOM with the ability to fire user events. The testing concept is very similar to E2E tests, e.g. Cypress, as you try to mimic how the user would use the component/ui. That way the tests are easy to understand and maintain, because the tests don't rely on testing the implementation details.
Quote from the react testing library docs:
You want to write maintainable tests for your React components. As a part of this goal, you want your tests to avoid including implementation details of your components and rather focus on making your tests give you the confidence for which they are intended. As part of this, you want your testbase to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.