Skip to content

Commit 936632c

Browse files
committed
refactor: remove Ctrl+n/Ctrl+p tests per review feedback
Tests for this functionality are considered overkill. Removed to keep CI times in check.
1 parent a154d28 commit 936632c

File tree

1 file changed

+0
-103
lines changed

1 file changed

+0
-103
lines changed

codex-rs/tui/src/bottom_pane/list_selection_view.rs

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -737,107 +737,4 @@ mod tests {
737737
);
738738
}
739739

740-
#[test]
741-
fn ctrl_n_moves_selection_down() {
742-
let mut view = make_selection_view(None);
743-
// Initial selection is on first item (Read Only which is_current)
744-
let initial = render_lines(&view);
745-
assert!(
746-
initial.contains("› 1. Read Only"),
747-
"expected first item selected initially"
748-
);
749-
750-
// Press Ctrl+n to move down
751-
view.handle_key_event(KeyEvent::new(
752-
KeyCode::Char('n'),
753-
KeyModifiers::CONTROL,
754-
));
755-
let after_ctrl_n = render_lines(&view);
756-
assert!(
757-
after_ctrl_n.contains("› 2. Full Access"),
758-
"expected second item selected after Ctrl+n"
759-
);
760-
}
761-
762-
#[test]
763-
fn ctrl_p_moves_selection_up() {
764-
let mut view = make_selection_view(None);
765-
// Move down first so we can move up
766-
view.handle_key_event(KeyEvent::new(KeyCode::Down, KeyModifiers::NONE));
767-
let after_down = render_lines(&view);
768-
assert!(
769-
after_down.contains("› 2. Full Access"),
770-
"expected second item selected after Down"
771-
);
772-
773-
// Press Ctrl+p to move up
774-
view.handle_key_event(KeyEvent::new(
775-
KeyCode::Char('p'),
776-
KeyModifiers::CONTROL,
777-
));
778-
let after_ctrl_p = render_lines(&view);
779-
assert!(
780-
after_ctrl_p.contains("› 1. Read Only"),
781-
"expected first item selected after Ctrl+p"
782-
);
783-
}
784-
785-
#[test]
786-
fn ctrl_n_and_ctrl_p_wrap_around() {
787-
let mut view = make_selection_view(None);
788-
// Move to second item
789-
view.handle_key_event(KeyEvent::new(
790-
KeyCode::Char('n'),
791-
KeyModifiers::CONTROL,
792-
));
793-
// Move past last item - should wrap to first
794-
view.handle_key_event(KeyEvent::new(
795-
KeyCode::Char('n'),
796-
KeyModifiers::CONTROL,
797-
));
798-
let wrapped_forward = render_lines(&view);
799-
assert!(
800-
wrapped_forward.contains("› 1. Read Only"),
801-
"expected selection to wrap to first item"
802-
);
803-
804-
// Move up from first item - should wrap to last
805-
view.handle_key_event(KeyEvent::new(
806-
KeyCode::Char('p'),
807-
KeyModifiers::CONTROL,
808-
));
809-
let wrapped_back = render_lines(&view);
810-
assert!(
811-
wrapped_back.contains("› 2. Full Access"),
812-
"expected selection to wrap to last item"
813-
);
814-
}
815-
816-
#[test]
817-
fn c0_control_chars_navigate_selection() {
818-
let mut view = make_selection_view(None);
819-
// Initial selection is on first item
820-
let initial = render_lines(&view);
821-
assert!(
822-
initial.contains("› 1. Read Only"),
823-
"expected first item selected initially"
824-
);
825-
826-
// Simulate terminals that send C0 control chars without CONTROL modifier.
827-
// ^N (U+000E) should move down
828-
view.handle_key_event(KeyEvent::new(KeyCode::Char('\u{000e}'), KeyModifiers::NONE));
829-
let after_c0_n = render_lines(&view);
830-
assert!(
831-
after_c0_n.contains("› 2. Full Access"),
832-
"expected second item selected after ^N (C0)"
833-
);
834-
835-
// ^P (U+0010) should move up
836-
view.handle_key_event(KeyEvent::new(KeyCode::Char('\u{0010}'), KeyModifiers::NONE));
837-
let after_c0_p = render_lines(&view);
838-
assert!(
839-
after_c0_p.contains("› 1. Read Only"),
840-
"expected first item selected after ^P (C0)"
841-
);
842-
}
843740
}

0 commit comments

Comments
 (0)