How snapshot tests work
When a user interface component is rendered, the test framework stores its output as a snapshot. This might include the HTML structure, component state, or any variations that arise from props or dynamic content. The next time the component runs through the test, the new output is compared against the original. If anything differs, the team can decide whether the change reflects a genuine improvement or an unintended break.
This approach provides a clear view of how components evolve, especially across large or fast-moving codebases. It also supports teams who depend heavily on design systems or reusable UI patterns.

