Over this lecture, we had a brief introduction to testing in react apps and I did mention that you can
dive deeper, that there are whole courses or articles diving just into testing and I can only encourage
you to dive deeper if you want to learn more about testing,
this is just a rough introduction.
One of the most important things when it comes to testing is the way you think about tests,
don't test unnecessary stuff because that unnecessary stuff often is the most difficult to test, if you're
testing the whole workflow from I click a button to my state updates to then something changes in another
component,
then you won't have fun simulating that. That will require a lot of difficult work and code where you
need to mock the h to the p calls so that you don't actually reach out to the server during your tests
and all of that isn't fun at all.
And it's not only no fun, it's also redundant because we don't need to test if we can reach out to
the server,
we need to test does our reducer work correctly,
do we update our components correctly if the input changes,
maybe we want to test do we find a correct prop if we click a certain button.
All these things can be easily tested in isolated unit tests
and this really is the way to think about it
and the way I encourage you to practice.