Open gdirk07 opened 2 years ago
I've had some mild success using Cypress for doing screenshot diffs and validating functionality (spawn a view with stub data, click on things, check the results), it might be worth investigating here. Cypress will run in a chrome tab and show live DOM updates, which does a lot more for tracking the render process than running Jest and praying things look correct.
I do agree that we'll want something a bit more robust than the unit tests moving forward, but a view causing a data fetch to fail feels like a bigger root issue that simple testing might not catch (we generally want to avoid calling the live API during a test).
If you want to read up on cypress, their site is available here:
I agree that there is a bigger root issue, but being able to catch it might be difficult, especially if the app gets bigger and bigger so having something in place could help and might be worth looking into
I played around with Cypress a bit, some thoughts
While we are writing Unit Tests, I think integration tests are something we should look at next since actions in one component will affect another, and the view will be affected. For example, a change in
PokemonDisplay
caused the app to no longer fetch abilities. I think it makes sense sooner than later to look into view testing to make sure the correct information is being display. I know Jest hassnapshots
I'm not sure if that's what we're looking for.