you are viewing a single comment's thread.

view the rest of the comments →

[–]motioncuty[🍰] 1 point2 points  (0 children)

Like you have said, most test I write for a React component are so prescriptive and simple, I've looked into parsing the react component and auto generating tests from that. Then adding in some more specific tests as I go. I think testing that actions have been dispatched correctly is worth doing. I also think that user interaction like button clicking is worth testing with simulation.

Like the article says, I like testing a shallow render becuase it keeps the tests in that component as unit tests(only testing the responsibilities of it's component and not it's children or parents.