test(tui): keep send-failed visible in crowded status_footer
All checks were successful
ci / test (pull_request) Successful in 3m5s
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:
parent
494a0e4099
commit
7d3e1bd627
2 changed files with 31 additions and 20 deletions
|
|
@ -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
|
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.
|
`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` locks this
|
`tests/tui_frames.rs` `status_footer_drops_send_failed_when_crowded` now asserts
|
||||||
current behavior so the implementation card can flip it.
|
the note **is** present at 80, 120, and 200, along with `TOR` / `me:` / `? help`.
|
||||||
|
|
||||||
### 80x24 — `draw_share` (real)
|
### 80x24 — `draw_share` (real)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -483,26 +483,37 @@ fn footer_drops_full_onion_at_80_keeps_it_at_120() {
|
||||||
assert!(at_80.contains("? help") && at_120.contains("? help"));
|
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`. Keep `TOR` / `me:` / `? help` at 80 and 120.
|
||||||
/// Spec: never drop `send failed`. Do not change `src/` on this card.
|
|
||||||
#[test]
|
#[test]
|
||||||
fn status_footer_drops_send_failed_when_crowded() {
|
fn status_footer_drops_send_failed_when_crowded() {
|
||||||
let note = "send failed: peer onion down";
|
let note = "send failed: peer onion down";
|
||||||
let at_80 = status_footer(80, FP, ONION, Some(note), main_footer_hints());
|
for (w, line) in [
|
||||||
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());
|
80u16,
|
||||||
assert!(
|
status_footer(80, FP, ONION, Some(note), main_footer_hints()),
|
||||||
!at_80.contains("send failed"),
|
),
|
||||||
"80 still has room? {at_80:?}"
|
(
|
||||||
);
|
120,
|
||||||
assert!(
|
status_footer(120, FP, ONION, Some(note), main_footer_hints()),
|
||||||
!at_120.contains("send failed"),
|
),
|
||||||
"120 still has room? {at_120:?}"
|
(
|
||||||
);
|
200,
|
||||||
assert!(
|
status_footer(200, FP, ONION, Some(note), main_footer_hints()),
|
||||||
at_200.contains("send failed"),
|
),
|
||||||
"200 should keep the note: {at_200:?}"
|
] {
|
||||||
);
|
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]
|
#[test]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue