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/layouts.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/layouts.rs')
| -rw-r--r-- | src/tests/integration/layouts.rs | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/tests/integration/layouts.rs b/src/tests/integration/layouts.rs deleted file mode 100644 index 6b91ba04..00000000 --- a/src/tests/integration/layouts.rs +++ /dev/null @@ -1,67 +0,0 @@ -use insta::assert_snapshot; -use std::path::PathBuf; - -use crate::tests::fakes::FakeInputOutput; -use crate::tests::start; -use crate::tests::utils::commands::QUIT; -use crate::tests::utils::get_output_frame_snapshots; -use crate::CliArgs; -use zellij_utils::input::config::Config; -use zellij_utils::pane_size::PositionAndSize; - -fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput { - FakeInputOutput::new(fake_win_size.clone()) -} - -#[test] -pub fn accepts_basic_layout() { - 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(&[&QUIT]); - let mut opts = CliArgs::default(); - opts.layout_path = Some(PathBuf::from( - "src/tests/fixtures/layouts/three-panes-with-nesting.yaml", - )); - - let layout = zellij_utils::input::layout::Layout::from_path_or_default( - None, - opts.layout_path.as_ref(), - Some(std::path::Path::new("unused").into()), - ); - - start( - Box::new(fake_input_output.clone()), - opts, - Box::new(fake_input_output.clone()), - Config::default(), - layout, - ); - 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_count = snapshots.len(); - let first_snapshot = snapshots.get(0).unwrap(); - let next_to_last_snapshot = snapshots.get(snapshot_count - 2).unwrap(); - let last_snapshot = snapshots.last().unwrap(); - // here we only test the first, next to last and last snapshot because there's a race condition - // with the other snapshots. Namely all the terminals are created asynchronously and read in an - // async task, so we have no way to guarantee the order in which their bytes will be read, and - // it doesn't really matter in this context. We just want to see that the layout is initially - // created properly and that in the end it's populated properly with its content - // - // we read the next to last as well as the last, because the last includes the "Bye from - // Zellij" message, and we also want to make sure things are fine before that - assert_snapshot!(first_snapshot); - assert_snapshot!(next_to_last_snapshot); - assert_snapshot!(last_snapshot); -} |
