Detect unintended changes — serialize component output and compare against stored snapshots for regression detection.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
Snapshot tests capture the rendered output of a component and compare it to a stored reference. Any change triggers a diff for review. Best for catching unintended UI changes. Inline snapshots keep expectations in the test file. Property-based snapshots focus on specific attributes rather than entire trees.