From 90451325d4c24f1aaa7d809696383e25ede6956e Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Sun, 10 Dec 2023 14:37:52 +0100 Subject: [PATCH] fixed tests --- src/gui/pages/types/settings_page.rs | 6 ++---- src/gui/types/sniffer.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/pages/types/settings_page.rs b/src/gui/pages/types/settings_page.rs index d0caf7bb..43c712b3 100644 --- a/src/gui/pages/types/settings_page.rs +++ b/src/gui/pages/types/settings_page.rs @@ -76,15 +76,13 @@ mod tests { SettingsPage::Appearance.previous(), SettingsPage::Notifications ); - assert_eq!(SettingsPage::Language.previous(), SettingsPage::Appearance); - assert_eq!(SettingsPage::General.previous(), SettingsPage::Language); + assert_eq!(SettingsPage::General.previous(), SettingsPage::Appearance); } #[test] fn test_next_settings_page() { assert_eq!(SettingsPage::Notifications.next(), SettingsPage::Appearance); - assert_eq!(SettingsPage::Appearance.next(), SettingsPage::Language); - assert_eq!(SettingsPage::Language.next(), SettingsPage::General); + assert_eq!(SettingsPage::Appearance.next(), SettingsPage::General); assert_eq!(SettingsPage::General.next(), SettingsPage::Notifications); } } diff --git a/src/gui/types/sniffer.rs b/src/gui/types/sniffer.rs index 5c5e8c73..29d217ad 100644 --- a/src/gui/types/sniffer.rs +++ b/src/gui/types/sniffer.rs @@ -870,24 +870,24 @@ mod tests { sniffer.update(Message::OpenSettings(SettingsPage::Appearance)); assert_eq!(sniffer.modal, None); assert_eq!(sniffer.settings_page, Some(SettingsPage::Appearance)); - sniffer.update(Message::OpenSettings(SettingsPage::Language)); + sniffer.update(Message::OpenSettings(SettingsPage::General)); assert_eq!(sniffer.modal, None); - assert_eq!(sniffer.settings_page, Some(SettingsPage::Language)); + assert_eq!(sniffer.settings_page, Some(SettingsPage::General)); // try opening modal with settings opened sniffer.update(Message::ShowModal(MyModal::Quit)); assert_eq!(sniffer.modal, None); - assert_eq!(sniffer.settings_page, Some(SettingsPage::Language)); + assert_eq!(sniffer.settings_page, Some(SettingsPage::General)); assert_eq!(sniffer.last_opened_setting, SettingsPage::Notifications); // close settings sniffer.update(Message::CloseSettings); assert_eq!(sniffer.modal, None); assert_eq!(sniffer.settings_page, None); - assert_eq!(sniffer.last_opened_setting, SettingsPage::Language); + assert_eq!(sniffer.last_opened_setting, SettingsPage::General); // reopen settings sniffer.update(Message::OpenLastSettings); assert_eq!(sniffer.modal, None); - assert_eq!(sniffer.settings_page, Some(SettingsPage::Language)); - assert_eq!(sniffer.last_opened_setting, SettingsPage::Language); + assert_eq!(sniffer.settings_page, Some(SettingsPage::General)); + assert_eq!(sniffer.last_opened_setting, SettingsPage::General); // switch settings page sniffer.update(Message::OpenSettings(SettingsPage::Appearance)); assert_eq!(sniffer.modal, None);