Which checks should survive a harmless visual refactor but catch an incorrect total?
Use a small snapshot when a reviewer can inspect the entire saved representation and unintended changes to it matter. Use targeted assertions for amounts, accessible labels, enabled actions and state transitions. A page-sized snapshot costs attention every time unrelated markup changes.
Separate the styling change from the pricing error
Imagine a receipt whose layout changes from two wrappers to one. A markup snapshot can show the difference even when the amount stays correct. Now change the price calculation while keeping the old receipt structure. An explicit assertion comparing the displayed and independently expected amounts makes the consequence easy for the reviewer to understand.
| Change | Snapshot evidence | Behavioural evidence |
|---|---|---|
| Markup is restructured | Diff identifies the affected subtree. | The correct paid amount remains visible. |
| Receipt total changes | The reviewer must interpret the changed text. | Exact amount assertion gives expected and observed values. |
| Receipt ID varies on every run | Use stable fixture values or a deliberate matcher. | Check the agreed format or relevant identity. |
| Pay action becomes disabled | Stored output may include an attribute change. | A user-oriented assertion checks whether payment is available. |
Give snapshot updates a reviewer
Snapshot acceptance replaces a baseline. Read the old and new values before approving the update, and keep stable input data so timestamps or IDs do not create constant churn. Put the amount and currency into named assertions so an otherwise reasonable template change cannot silently redefine the intended price.