4 ms·
Exactly this. Unless your product is components (e.g. you are in a team building UI kit) it's better to have unit tests for util functions and integration/e2e t
by morbicer 2y ago
Exactly this. Unless your product is components (e.g. you are in a team building UI kit) it's better to have unit tests for util functions and integration/e2e tests in Playwright or Cypress.
We try to avoid logic directly in components so apart from few exceptions (like complex tree pickers) it's moot to test them. For these few exceptions RTL serves us pretty well.
Testing redux reducers was cleaner back in time but hooks can be tested with renderHook/act and that's where your logic should be.