update tests for no spinner

This commit is contained in:
easong-openai
2025-08-04 21:13:23 -07:00
parent bbb266d0da
commit 0fa18da362
2 changed files with 13 additions and 18 deletions

View File

@@ -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:?}"
);
}
}

View File

@@ -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::<AppEvent>();
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:?}");
}
}