From ea9e23781016fe2be4d71e667bac0175ae2aa570 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 3 Oct 2024 10:09:37 -0600 Subject: [PATCH] Remove tab zoom tests as it now involves an interaction with the app --- src/app.rs | 13 ------------- src/tab.rs | 25 +------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/src/app.rs b/src/app.rs index e5d15cb..06e3008 100644 --- a/src/app.rs +++ b/src/app.rs @@ -3813,19 +3813,6 @@ pub(crate) mod test_utils { ); } - pub fn assert_zoom_affects_item_size(tab: &mut Tab, message: tab::Message, should_zoom: bool) { - let grid_icon_size = tab.config.icon_sizes.grid; - let list_icon_size = tab.config.icon_sizes.list; - - debug!("Emitting {:?}", message); - tab.update(message, Modifiers::empty()); - - let grid_size_changed = grid_icon_size != tab.config.icon_sizes.grid; - let list_size_changed = list_icon_size != tab.config.icon_sizes.list; - - assert_eq!(grid_size_changed || list_size_changed, should_zoom); - } - /// Assert that tab's items are equal to a path's entries. pub fn assert_eq_tab_path_contents(tab: &Tab, path: &Path) { let Location::Path(ref tab_path) = tab.location else { diff --git a/src/tab.rs b/src/tab.rs index b56b2f8..bbbab16 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -4041,7 +4041,7 @@ mod tests { use super::{respond_to_scroll_direction, scan_path, Location, Message, Tab}; use crate::{ app::test_utils::{ - assert_eq_tab_path, assert_zoom_affects_item_size, empty_fs, eq_path_item, filter_dirs, + assert_eq_tab_path, empty_fs, eq_path_item, filter_dirs, read_dir_sorted, simple_fs, tab_click_new, NAME_LEN, NUM_DIRS, NUM_FILES, NUM_HIDDEN, NUM_NESTED, }, @@ -4276,29 +4276,6 @@ mod tests { Ok(()) } - #[test] - fn tab_zoom_in_increases_item_view_size() -> io::Result<()> { - let fs = simple_fs(0, NUM_NESTED, NUM_DIRS, 0, NAME_LEN)?; - let path = fs.path(); - - let mut tab = Tab::new(Location::Path(path.into()), TabConfig::default()); - - let should_affect_size = true; - assert_zoom_affects_item_size(&mut tab, Message::ZoomIn, should_affect_size); - Ok(()) - } - - fn tab_zoom_out_decreases_item_view_size() -> io::Result<()> { - let fs = simple_fs(0, NUM_NESTED, NUM_DIRS, 0, NAME_LEN)?; - let path = fs.path(); - - let mut tab = Tab::new(Location::Path(path.into()), TabConfig::default()); - - let should_affect_size = true; - assert_zoom_affects_item_size(&mut tab, Message::ZoomOut, should_affect_size); - Ok(()) - } - #[test] fn tab_scroll_up_with_ctrl_modifier_zooms() -> io::Result<()> { let message_maybe =