diff options
author | raphCode <15750438+raphCode@users.noreply.github.com> | 2022-04-29 16:16:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 16:16:53 +0200 |
commit | 1f4e3d88c881e5402339a4a54750f06143f302ab (patch) | |
tree | ce4d8a988d18040d451490d81468711e1d1abc00 /zellij-server/src/tab/unit/tab_integration_tests.rs | |
parent | b0a29c046a21e3ecb0c59c2f09d693f9f6e99738 (diff) |
Fix crash on renaming a floating pane (#1323) (#1357)
* Fix crash on renaming a floating pane (#1323)
* Add rename tests for embedded and floating panes
* docs(changelog): fix floating pane rename
Diffstat (limited to 'zellij-server/src/tab/unit/tab_integration_tests.rs')
-rw-r--r-- | zellij-server/src/tab/unit/tab_integration_tests.rs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/zellij-server/src/tab/unit/tab_integration_tests.rs b/zellij-server/src/tab/unit/tab_integration_tests.rs index 352efadc7..fc35b444a 100644 --- a/zellij-server/src/tab/unit/tab_integration_tests.rs +++ b/zellij-server/src/tab/unit/tab_integration_tests.rs @@ -1097,6 +1097,57 @@ fn replacing_existing_wide_characters() { } #[test] +fn rename_embedded_pane() { + let size = Size { + cols: 121, + rows: 20, + }; + let client_id = 1; + let mut tab = create_new_tab(size); + let mut output = Output::default(); + tab.handle_pty_bytes( + 1, + Vec::from("\n\n\n I am an embedded pane".as_bytes()), + ); + tab.update_active_pane_name("Renamed empedded pane".as_bytes().to_vec(), client_id); + tab.render(&mut output, None); + let snapshot = take_snapshot( + output.serialize().get(&client_id).unwrap(), + size.rows, + size.cols, + Palette::default(), + ); + assert_snapshot!(snapshot); +} + +#[test] +fn rename_floating_pane() { + let size = Size { + cols: 121, + rows: 20, + }; + let client_id = 1; + let mut tab = create_new_tab(size); + let new_pane_id = PaneId::Terminal(2); + let mut output = Output::default(); + tab.new_pane(new_pane_id, Some(client_id)); + tab.handle_pty_bytes( + 2, + Vec::from("\n\n\n I am a floating pane".as_bytes()), + ); + tab.toggle_pane_embed_or_floating(client_id); + tab.update_active_pane_name("Renamed floating pane".as_bytes().to_vec(), client_id); + tab.render(&mut output, None); + let snapshot = take_snapshot( + output.serialize().get(&client_id).unwrap(), + size.rows, + size.cols, + Palette::default(), + ); + assert_snapshot!(snapshot); +} + +#[test] fn wide_characters_in_left_title_side() { // this test makes sure the title doesn't overflow when it has wide characters let size = Size { |