From b51d637c5ff3418420801cd9b457fc073fa98adc Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Thu, 10 Apr 2025 10:07:07 +0200 Subject: [PATCH] test(plot_base): test for plot base re-enabled --- tests/unit_tests/test_plot_base_next_gen.py | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/unit_tests/test_plot_base_next_gen.py b/tests/unit_tests/test_plot_base_next_gen.py index 35e41b28..db8386da 100644 --- a/tests/unit_tests/test_plot_base_next_gen.py +++ b/tests/unit_tests/test_plot_base_next_gen.py @@ -313,26 +313,26 @@ def test_enable_side_panel_property(qtbot, mocked_client): assert pb.ui_mode == UIMode.NONE -# def test_switching_between_popup_and_side_panel_closes_dialog(qtbot, mocked_client): -# """ -# Test that if a popup dialog is open (via the axis settings popup) then switching -# to side-panel mode closes the dialog. -# """ -# pb = create_widget(qtbot, PlotBase, client=mocked_client) -# pb.ui_mode = UIMode.POPUP -# # Open the axis settings popup. -# pb.show_axis_settings_popup() -# qtbot.wait(100) -# # The dialog should now exist and be visible. -# assert pb.axis_settings_dialog is not None -# assert pb.axis_settings_dialog.isVisible() is True +def test_switching_between_popup_and_side_panel_closes_dialog(qtbot, mocked_client): + """ + Test that if a popup dialog is open (via the axis settings popup) then switching + to side-panel mode closes the dialog. + """ + pb = create_widget(qtbot, PlotBase, client=mocked_client) + pb.ui_mode = UIMode.POPUP + # Open the axis settings popup. + pb.show_axis_settings_popup() + qtbot.wait(100) + # The dialog should now exist and be visible. + assert pb.axis_settings_dialog is not None + assert pb.axis_settings_dialog.isVisible() is True -# # Switch to side panel mode. -# pb.ui_mode = UIMode.SIDE -# qtbot.wait(100) -# # The axis settings dialog should be closed (and reference cleared). + # Switch to side panel mode. + pb.ui_mode = UIMode.SIDE + qtbot.wait(100) + # The axis settings dialog should be closed (and reference cleared). -# qtbot.waitUntil(lambda: pb.axis_settings_dialog is None, timeout=5000) + qtbot.waitUntil(lambda: pb.axis_settings_dialog is None, timeout=5000) def test_enable_fps_monitor_property(qtbot, mocked_client):