diff --git a/tests/unit/gui/test_log_panel.py b/tests/unit/gui/test_log_panel.py index 962ad6df..8b8df096 100644 --- a/tests/unit/gui/test_log_panel.py +++ b/tests/unit/gui/test_log_panel.py @@ -29,3 +29,14 @@ def test_notification_requests_reveal(qtbot): with qtbot.waitSignal(panel.reveal_requested, timeout=1000): panel.show_notification(title="Boom", message="it broke") assert panel.notification._title.text() == "Boom" + + +def test_sticky_notification_is_dismissable(qtbot): + # Sticky means "no auto-clear timer", not "undismissable": the Clear + # button must stay so users can get rid of stale warnings by hand. + panel = LogPanel() + qtbot.addWidget(panel) + panel.show_notification(title="Warn", message="stuck", level="warning", sticky=True) + assert not panel.notification._clear_button.isHidden() + panel.notification._clear_button.click() + assert not panel.notification.isVisible()