From eae8191f7ef260f721296ef766af1e20ce424b80 Mon Sep 17 00:00:00 2001 From: Oscar Gustafsson <oscar.gustafsson@gmail.com> Date: Wed, 25 Jan 2023 17:13:37 +0100 Subject: [PATCH] Add smoke test for help dialogs --- b_asic/GUI/main_window.py | 6 +++--- test/test_gui.py | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/b_asic/GUI/main_window.py b/b_asic/GUI/main_window.py index de1cca36..5420bc01 100644 --- a/b_asic/GUI/main_window.py +++ b/b_asic/GUI/main_window.py @@ -739,15 +739,15 @@ class MainWindow(QMainWindow): # Kinda buggy because of the separate window in the same thread. self.dialog.simulate.connect(self._simulate_sfg) - def display_faq_page(self): + def display_faq_page(self, event=None): self.faq_page = FaqWindow(self) self.faq_page.scroll_area.show() - def display_about_page(self): + def display_about_page(self, event=None): self.about_page = AboutWindow(self) self.about_page.show() - def display_keybinds_page(self): + def display_keybinds_page(self, event=None): self.keybinds_page = KeybindsWindow(self) self.keybinds_page.show() diff --git a/test/test_gui.py b/test/test_gui.py index 301aacd7..7dab9d38 100644 --- a/test/test_gui.py +++ b/test/test_gui.py @@ -127,3 +127,16 @@ def test_select_operation(qtbot, datadir): assert len(widget.pressed_operations) == 1 widget.exit_app() + + +def test_help_dialogs(qtbot): + # Smoke test to open up the "help dialogs" + # Should really test doing this through the menus an/or closing them + widget = GUI.MainWindow() + qtbot.addWidget(widget) + + widget.display_faq_page() + widget.display_about_page() + widget.display_keybinds_page() + + widget.exit_app() -- GitLab