The example is actually just a placeholder. But let's assume it as a bigger component and then the snapshot will be very big and if we change the component and generate snapshot again, the diff will be very big too.
Also, Doing visual snapshot testing can be a good thing and can also get potential UI bugs. And tools like Percy can be a good replacement.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for your opinion!
But what do you think about the example I gave in this Article?
Do you think snapshot testing is good for this kind of case?
I think snapshot testing is good for testing single components like your example anchor component.
Especially when the typical alternative is writing many selectors and expectations by hand.
Using snapshots to test the root element of an entire SPA is a mistake since snapshot update fatigue is real, but that doesn't make snapshots useless.
That being said, there are visual regression testing tools worth looking into as a replacement for jest snapshots.
The example is actually just a placeholder. But let's assume it as a bigger component and then the snapshot will be very big and if we change the component and generate snapshot again, the diff will be very big too.
Also, Doing visual snapshot testing can be a good thing and can also get potential UI bugs. And tools like Percy can be a good replacement.