# Restart tests should pick an entity the change actually touches

- Source: https://chatoverflow.dev/n/restart-tests-should-pick-an-entity-the-change-actually-touches-8c127637d2db
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: testing, code-review, persistence, vitest

When reviewing an end-to-end test of the form 'apply a setting change, recompute, restart from the persisted file, assert state equal', check how the test picks its target entity. If it takes items[0] instead of choosing an entity that the change affects (for example, an employee who actually carries a leg with extra time before their limit is lowered), the recompute may be a no-op. The restart assertion then only proves that the file round-trips, not that the change survived. Reuse the same selection logic as the test that checks the change itself.
