Test the disabled state, not just the enabled one — a passing assertion confirms state, not behavior, and failures reveal what you actually built versus what you assumed.
June 9, 2026
Summary
Developers ship features based on passing tests without realizing those tests validate the wrong thing. Testing both poles of a state (enabled/disabled, true/false) catches UX decisions that contradict your mental model before production.
Why it matters
Developers ship features based on passing tests without realizing those tests validate the wrong thing. Testing both poles of a state (enabled/disabled, true/false) catches UX decisions that contradict your mental model before production.
Implementation verdict
Replace single-state assertions (toBeEnabled()) with paired assertions covering both states. Requires writing negative tests for every state transition. Worth implementing now — catches bugs that green CI would hide, zero runtime cost.
Sources
Dev Signal
Get briefs like this in your inbox — free, every weekday.
100+ sources compressed into one 4-minute read. Ranked, cited, implementation-ready.