From 0fa18da362f87d7c71f9a5c2fcace586cf767e2a Mon Sep 17 00:00:00 2001 From: easong-openai Date: Mon, 4 Aug 2025 21:13:23 -0700 Subject: [PATCH] update tests for no spinner --- codex-rs/tui/src/bottom_pane/mod.rs | 20 ++++++++++---------- codex-rs/tui/src/status_indicator_widget.rs | 11 +++-------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/codex-rs/tui/src/bottom_pane/mod.rs b/codex-rs/tui/src/bottom_pane/mod.rs index 34161e02d8..fde0b3bde8 100644 --- a/codex-rs/tui/src/bottom_pane/mod.rs +++ b/codex-rs/tui/src/bottom_pane/mod.rs @@ -528,15 +528,15 @@ mod tests { } assert!(r2.trim().is_empty(), "expected blank spacer line: {r2:?}"); - // Bottom row is the status line; it should contain the left bar and "Working [". + // Bottom row is the status line; it should contain the left bar and "Working". let mut r3 = String::new(); for x in 0..area.width { r3.push(buf[(x, 3)].symbol().chars().next().unwrap_or(' ')); } assert_eq!(buf[(0, 3)].symbol().chars().next().unwrap_or(' '), '▌'); assert!( - r3.contains("Working ["), - "expected spinner prefix in status line: {r3:?}" + r3.contains("Working"), + "expected Working header in status line: {r3:?}" ); } @@ -564,15 +564,15 @@ mod tests { let mut buf = Buffer::empty(area); (&pane).render_ref(area, &mut buf); - // Top row contains the spinner + // Top row contains the status header let mut top = String::new(); for x in 0..area.width { top.push(buf[(x, 0)].symbol().chars().next().unwrap_or(' ')); } assert_eq!(buf[(0, 0)].symbol().chars().next().unwrap_or(' '), '▌'); assert!( - top.contains("Working ["), - "expected spinner on top row: {top:?}" + top.contains("Working"), + "expected Working header on top row: {top:?}" ); // Bottom two rows are blank padding @@ -616,8 +616,8 @@ mod tests { row1.push(buf2[(x, 1)].symbol().chars().next().unwrap_or(' ')); } assert!( - row0.contains("Working ["), - "expected spinner on row 0: {row0:?}" + row0.contains("Working"), + "expected Working header on row 0: {row0:?}" ); assert!( row1.trim().is_empty(), @@ -633,8 +633,8 @@ mod tests { only.push(buf1[(x, 0)].symbol().chars().next().unwrap_or(' ')); } assert!( - only.contains("Working ["), - "expected spinner only with no padding: {only:?}" + only.contains("Working"), + "expected Working header with no padding: {only:?}" ); } } diff --git a/codex-rs/tui/src/status_indicator_widget.rs b/codex-rs/tui/src/status_indicator_widget.rs index 24a200138a..fad7e41a39 100644 --- a/codex-rs/tui/src/status_indicator_widget.rs +++ b/codex-rs/tui/src/status_indicator_widget.rs @@ -279,7 +279,7 @@ mod tests { } #[test] - fn bracket_dot_animation_is_present_on_last_line() { + fn working_header_is_present_on_last_line() { let (tx_raw, _rx) = channel::(); let tx = AppEventSender::new(tx_raw); let mut w = StatusIndicatorWidget::new(tx); @@ -291,16 +291,11 @@ mod tests { let mut buf = ratatui::buffer::Buffer::empty(area); w.render_ref(area, &mut buf); - // Single line; it should contain "Working [" and closing "]" and the provided text. + // Single line; it should contain the animated "Working" header. let mut row = String::new(); for x in 0..area.width { row.push(buf[(x, 0)].symbol().chars().next().unwrap_or(' ')); } - assert!(row.contains("Working ["), "expected status prefix: {row:?}"); - assert!(row.contains("]"), "expected bracket: {row:?}"); - assert!( - row.contains("Hi"), - "expected provided text in status: {row:?}" - ); + assert!(row.contains("Working"), "expected Working header: {row:?}"); } }