diff options
| author | Aram Drevekenin <aram@poor.dev> | 2021-06-30 11:27:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-30 11:27:35 +0200 |
| commit | ed4fd2a8e77df304539ca7f445a78039028eaa8a (patch) | |
| tree | ae48b03370b11f3f0987676584724463ac83460d /src/tests/integration/resize_down.rs | |
| parent | Merge pull request #590 from a-kenji/clippy-fixes (diff) | |
| download | sl0ppij-ed4fd2a8e77df304539ca7f445a78039028eaa8a.tar.gz sl0ppij-ed4fd2a8e77df304539ca7f445a78039028eaa8a.tar.xz sl0ppij-ed4fd2a8e77df304539ca7f445a78039028eaa8a.zip | |
chore(tests): move all integration tests to be either unit or e2e tests - remove old testing infra (#589)
* tests(integration): move basic integration tests to be unit tests
* fix(tests): silently fail threadbus for tests
* tests(unit): move compatibility tests to become unit tests for grid
* tests(unit): move close_pane tests to become unit tests for grid
* tests(e2e): move basic layout test to e2e
* tests(unit): move move_focus tests to be unit tests
* tests(unit): move resize_down tests to be unit tests
* tests(unit): move resize_left tests to be unit tests
* tests(unit): move resize_right tests to be unit tests
* tests(unit): move resize_up tests to be unit tests
* tests(infra): remove unused infra
* style(fmt): make rustfmt happy
* debug
* debug
* debug
* debug
* chore(test): shift volume mounting around because github actions is a special child
Diffstat (limited to 'src/tests/integration/resize_down.rs')
| -rw-r--r-- | src/tests/integration/resize_down.rs | 725 |
1 files changed, 0 insertions, 725 deletions
diff --git a/src/tests/integration/resize_down.rs b/src/tests/integration/resize_down.rs deleted file mode 100644 index 110f0e49..00000000 --- a/src/tests/integration/resize_down.rs +++ /dev/null @@ -1,725 +0,0 @@ -use insta::assert_snapshot; - -use crate::tests::fakes::FakeInputOutput; -use crate::tests::start; -use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots}; -use crate::CliArgs; -use zellij_utils::pane_size::PositionAndSize; - -use crate::tests::utils::commands::{ - MOVE_FOCUS_IN_PANE_MODE, PANE_MODE, QUIT, RESIZE_DOWN_IN_RESIZE_MODE, - RESIZE_LEFT_IN_RESIZE_MODE, RESIZE_MODE, SLEEP, SPLIT_DOWN_IN_PANE_MODE, - SPLIT_RIGHT_IN_PANE_MODE, -}; -use zellij_utils::input::config::Config; - -fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput { - FakeInputOutput::new(*fake_win_size) -} - -#[test] -pub fn resize_down_with_pane_above() { - // ┌───────────┐ ┌───────────┐ - // │ │ │ │ - // │ │ │ │ - // ├───────────┤ ==resize=down==> │ │ - // │███████████│ ├───────────┤ - // │███████████│ │███████████│ - // │███████████│ │███████████│ - // └───────────┘ └───────────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_pane_below() { - // ┌───────────┐ ┌───────────┐ - // │███████████│ │███████████│ - // │███████████│ │███████████│ - // ├───────────┤ ==resize=down==> │███████████│ - // │ │ ├───────────┤ - // │ │ │ │ - // └───────────┘ └───────────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_above_and_below() { - // ┌───────────┐ ┌───────────┐ - // │ │ │ │ - // │ │ │ │ - // ├───────────┤ ├───────────┤ - // │███████████│ ==resize=down==> │███████████│ - // │███████████│ │███████████│ - // │███████████│ │███████████│ - // ├───────────┤ │███████████│ - // │ │ ├───────────┤ - // │ │ │ │ - // └───────────┘ └───────────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 121, - rows: 25, - 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, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_multiple_panes_above() { - // - // ┌─────┬─────┐ ┌─────┬─────┐ - // │ │ │ │ │ │ - // ├─────┴─────┤ ==resize=down==> │ │ │ - // │███████████│ ├─────┴─────┤ - // │███████████│ │███████████│ - // └───────────┘ └───────────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_above_aligned_left_with_current_pane() { - // ┌─────┬─────┐ ┌─────┬─────┐ - // │ │ │ │ │ │ - // │ │ │ │ │ │ - // ├─────┼─────┤ ==resize=down==> ├─────┤ │ - // │ │█████│ │ ├─────┤ - // │ │█████│ │ │█████│ - // └─────┴─────┘ └─────┴─────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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_RIGHT_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_below_aligned_left_with_current_pane() { - // ┌─────┬─────┐ ┌─────┬─────┐ - // │ │█████│ │ │█████│ - // │ │█████│ │ │█████│ - // ├─────┼─────┤ ==resize=down==> ├─────┤█████│ - // │ │ │ │ ├─────┤ - // │ │ │ │ │ │ - // └─────┴─────┘ └─────┴─────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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_RIGHT_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_above_aligned_right_with_current_pane() { - // ┌─────┬─────┐ ┌─────┬─────┐ - // │ │ │ │ │ │ - // │ │ │ │ │ │ - // ├─────┼─────┤ ==resize=down==> │ ├─────┤ - // │█████│ │ ├─────┤ │ - // │█████│ │ │█████│ │ - // └─────┴─────┘ └─────┴─────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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_RIGHT_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_below_aligned_right_with_current_pane() { - // ┌─────┬─────┐ ┌─────┬─────┐ - // │█████│ │ │█████│ │ - // │█████│ │ │█████│ │ - // ├─────┼─────┤ ==resize=down==> │█████├─────┤ - // │ │ │ ├─────┤ │ - // │ │ │ │ │ │ - // └─────┴─────┘ └─────┴─────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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_RIGHT_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() { - // ┌───┬───┬───┐ ┌───┬───┬───┐ - // │ │ │ │ │ │ │ │ - // │ │ │ │ │ │ │ │ - // ├───┼───┼───┤ ==resize=down==> ├───┤ ├───┤ - // │ │███│ │ │ ├───┤ │ - // │ │███│ │ │ │███│ │ - // └───┴───┴───┘ └───┴───┴───┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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_RIGHT_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SLEEP, - &SPLIT_DOWN_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() { - // ┌───┬───┬───┐ ┌───┬───┬───┐ - // │ │███│ │ │ │███│ │ - // │ │███│ │ │ │███│ │ - // ├───┼───┼───┤ ==resize=down==> ├───┤███├───┤ - // │ │ │ │ │ ├───┤ │ - // │ │ │ │ │ │ │ │ - // └───┴───┴───┘ └───┴───┴───┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 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_RIGHT_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SLEEP, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_above_aligned_left_and_right_with_panes_to_the_left_and_right() { - // ┌─┬───────┬─┐ ┌─┬───────┬─┐ - // │ │ │ │ │ │ │ │ - // │ │ │ │ │ │ │ │ - // ├─┼─┬───┬─┼─┤ ==resize=down==> ├─┤ ├─┤ - // │ │ │███│ │ │ │ ├─┬───┬─┤ │ - // │ │ │███│ │ │ │ │ │███│ │ │ - // └─┴─┴───┴─┴─┘ └─┴─┴───┴─┴─┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 121, - rows: 40, - 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_RIGHT_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &PANE_MODE, - &SLEEP, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SLEEP, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn resize_down_with_panes_below_aligned_left_and_right_with_to_the_left_and_right() { - // ┌─┬─┬───┬─┬─┐ ┌─┬─┬───┬─┬─┐ - // │ │ │███│ │ │ │ │ │███│ │ │ - // │ │ │███│ │ │ │ │ │███│ │ │ - // ├─┼─┴───┴─┼─┤ ==resize=down==> ├─┤ │███│ ├─┤ - // │ │ │ │ │ ├─┴───┴─┤ │ - // │ │ │ │ │ │ │ │ - // └─┴───────┴─┘ └─┴───────┴─┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 121, - rows: 40, - 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_RIGHT_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &PANE_MODE, - &SLEEP, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_DOWN_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &SPLIT_RIGHT_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &MOVE_FOCUS_IN_PANE_MODE, - &RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_LEFT_IN_RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} - -#[test] -pub fn cannot_resize_down_when_pane_below_is_at_minimum_height() { - // ┌───────────┐ ┌───────────┐ - // │███████████│ │███████████│ - // ├───────────┤ ==resize=down==> ├───────────┤ - // │ │ │ │ - // └───────────┘ └───────────┘ - // █ == focused pane - let fake_win_size = PositionAndSize { - cols: 121, - rows: 7, - 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, - &RESIZE_MODE, - &RESIZE_DOWN_IN_RESIZE_MODE, - &SLEEP, - &QUIT, - ]); - start( - Box::new(fake_input_output.clone()), - CliArgs::default(), - Box::new(fake_input_output.clone()), - Config::default(), - None, - ); - - 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); -} |
