Open penx opened 5 years ago
We're generally using snapshots tests to sanity check any composed components that we pass params to, so we're not duplicating the testing we've already done in the specific component tests.
Worth a look to see if we can do this in a friendlier way for porting.
I am pretty sure that the use of Jest snapshots in govuk-frontend is mainly due to their ease of implementation - and could be replaced by tests that use axiom to look for specific properties of the render output.
Using snapshots means that if a change is made that introduces a white space change or changes the html attribute order, according to the snapshot test this is a failure - generally I would say this is a false positive.
This is of particular concern when developing a port and wanting to ensure the port adheres to all of the same unit tests for templates - the snapshots files are hard to manage across projects and raise false positives.
Related:
Some articles against snapshot testing:
From the first link