I have been working on achieving a 100% test coverage report for my React project, specifically focusing on unit testing. While I understand that having full coverage is not necessary, I am determined to explore ways to cover all tests for a Stateless Functional Component (SFC) in order to achieve a perfect score.
Below is the code snippet of my component:
(Component code here...)
When I run the command "yarn test --coverage", I see the following coverage result:
update-user.component.jsx | 66.67 | 0 | 25 | 85.71 | 73 |
Here is what my current test looks like:
(Test code here...)
My main concern now is how to ensure proper test coverage for the dispatch function getUser(). Any insights or suggestions would be greatly appreciated. Thank you!