diff options
Diffstat (limited to 'src/tests/integration/move_focus_right.rs')
-rw-r--r-- | src/tests/integration/move_focus_right.rs | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/tests/integration/move_focus_right.rs b/src/tests/integration/move_focus_right.rs index c6c17a750..e5d5ef3e8 100644 --- a/src/tests/integration/move_focus_right.rs +++ b/src/tests/integration/move_focus_right.rs @@ -7,8 +7,9 @@ use crate::{start, CliArgs}; use crate::common::input::config::Config; use crate::tests::utils::commands::{ - MOVE_FOCUS_LEFT_IN_PANE_MODE, MOVE_FOCUS_RIGHT_IN_PANE_MODE, PANE_MODE, QUIT, - SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE, + ENTER, MOVE_FOCUS_LEFT_IN_PANE_MODE, MOVE_FOCUS_RIGHT_IN_NORMAL_MODE, + MOVE_FOCUS_RIGHT_IN_PANE_MODE, NEW_TAB_IN_TAB_MODE, PANE_MODE, QUIT, SPLIT_DOWN_IN_PANE_MODE, + SPLIT_RIGHT_IN_PANE_MODE, TAB_MODE, }; fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput { @@ -86,3 +87,41 @@ pub fn move_focus_right_to_the_most_recently_used_pane() { get_next_to_last_snapshot(snapshots).expect("could not find snapshot"); assert_snapshot!(snapshot_before_quit); } + +#[test] +pub fn move_focus_right_changes_tab() { + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, + ..Default::default() + }; + let mut fake_input_output = get_fake_os_input(&fake_win_size); + fake_input_output.add_terminal_input(&[ + &PANE_MODE, + &SPLIT_DOWN_IN_PANE_MODE, + &ENTER, + &TAB_MODE, + &NEW_TAB_IN_TAB_MODE, + &ENTER, + &MOVE_FOCUS_RIGHT_IN_NORMAL_MODE, + &QUIT, + ]); + start( + Box::new(fake_input_output.clone()), + CliArgs::default(), + Box::new(fake_input_output.clone()), + Config::default(), + ); + + let output_frames = fake_input_output + .stdout_writer + .output_frames + .lock() + .unwrap(); + let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size); + let snapshot_before_quit = + get_next_to_last_snapshot(snapshots).expect("could not find snapshot"); + assert_snapshot!(snapshot_before_quit); +} |