test(tui): keep send-failed visible in crowded status_footer
All checks were successful
ci / test (pull_request) Successful in 3m5s

PR #23 locked the old drop. Flip status_footer_drops_send_failed_when_crowded
to assert the note stays at 80/120/200 with TOR, me:, and ? help.
This commit is contained in:
Sirius DevOps 2026-09-12 00:22:04 -04:00
commit 7d3e1bd627
No known key found for this signature in database
2 changed files with 31 additions and 20 deletions

View file

@ -483,26 +483,37 @@ fn footer_drops_full_onion_at_80_keeps_it_at_120() {
assert!(at_80.contains("? help") && at_120.contains("? help"));
}
/// Current `status_footer` drops fail-closed copy when ident+hints fill the row.
/// Spec: never drop `send failed`. Do not change `src/` on this card.
/// Spec: never drop `send failed`. Keep `TOR` / `me:` / `? help` at 80 and 120.
#[test]
fn status_footer_drops_send_failed_when_crowded() {
let note = "send failed: peer onion down";
let at_80 = status_footer(80, FP, ONION, Some(note), main_footer_hints());
let at_120 = status_footer(120, FP, ONION, Some(note), main_footer_hints());
let at_200 = status_footer(200, FP, ONION, Some(note), main_footer_hints());
assert!(
!at_80.contains("send failed"),
"80 still has room? {at_80:?}"
);
assert!(
!at_120.contains("send failed"),
"120 still has room? {at_120:?}"
);
assert!(
at_200.contains("send failed"),
"200 should keep the note: {at_200:?}"
);
for (w, line) in [
(
80u16,
status_footer(80, FP, ONION, Some(note), main_footer_hints()),
),
(
120,
status_footer(120, FP, ONION, Some(note), main_footer_hints()),
),
(
200,
status_footer(200, FP, ONION, Some(note), main_footer_hints()),
),
] {
assert!(
line.chars().count() <= w as usize,
"{w} footer wider than frame: {} {line:?}",
line.chars().count()
);
assert!(
line.contains("send failed"),
"{w} dropped fail-closed note: {line:?}"
);
assert!(line.contains("TOR"), "{w} missing TOR: {line:?}");
assert!(line.contains("me:"), "{w} missing me:: {line:?}");
assert!(line.contains("? help"), "{w} missing ? help: {line:?}");
}
}
#[test]