diff --git a/docs/TUI.md b/docs/TUI.md index f0996bd..925d351 100644 --- a/docs/TUI.md +++ b/docs/TUI.md @@ -143,9 +143,9 @@ chat/composer is **not** visible in the glyph dump (color-only in `pane_block`). TOR me:abcdef01… onion:abcdefgh… Tab F2 F3 F4 F5 Ctrl-Q ? help ``` -`status_note` was `send failed: peer onion down`. It is not on the frame. -`tests/tui_frames.rs` `status_footer_drops_send_failed_when_crowded` locks this -current behavior so the implementation card can flip it. +`status_note` was `send failed: peer onion down`. The before frame above drops it. +`tests/tui_frames.rs` `status_footer_drops_send_failed_when_crowded` now asserts +the note **is** present at 80, 120, and 200, along with `TOR` / `me:` / `? help`. ### 80x24 — `draw_share` (real) diff --git a/tests/tui_frames.rs b/tests/tui_frames.rs index e03d514..a262283 100644 --- a/tests/tui_frames.rs +++ b/tests/tui_frames.rs @@ -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]