test(engine): align card-shadow drag-vs-idle assertion with Terminal "no shadow" intent
Commit 0d477ac (the Terminal token system) pinned both
CARD_SHADOW_ALPHA_IDLE and CARD_SHADOW_ALPHA_DRAG to 0.0 because the
Terminal design system explicitly disallows box-shadow ("depth via
1px borders and tonal layering"). The existing invariant
\`drag_alpha > idle_alpha\` then fails — \`0.0 > 0.0\` is false.
Loosen the assertion to \`drag_alpha >= idle_alpha\` and document the
intent: under Terminal both are 0; under any future palette that
re-enables shadows, drag still must not be weaker than idle. The
useful regression-guard (catching an accidental swap of the two
constants) is preserved.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2329,9 +2329,15 @@ mod tests {
|
||||
|
||||
assert_ne!(idle_offset, drag_offset, "drag offset must differ from idle");
|
||||
assert_ne!(idle_padding, drag_padding, "drag padding must differ from idle");
|
||||
// Under the Terminal design system both alphas are pinned to 0
|
||||
// (depth comes from 1px borders + tonal layering, no `box-shadow`).
|
||||
// The invariant we still enforce is "drag never weaker than idle"
|
||||
// — so an accidental swap of the two constants fails loudly,
|
||||
// and a future palette that re-enables shadows still has to keep
|
||||
// the lift cue stronger than the rest state.
|
||||
assert!(
|
||||
drag_alpha > idle_alpha,
|
||||
"drag alpha must be stronger than idle (got drag={drag_alpha}, idle={idle_alpha})"
|
||||
drag_alpha >= idle_alpha,
|
||||
"drag alpha must not be weaker than idle (got drag={drag_alpha}, idle={idle_alpha})"
|
||||
);
|
||||
// Drag offset magnitude should be larger than idle so the parallax
|
||||
// reads as "lifted".
|
||||
|
||||
Reference in New Issue
Block a user