test: log panel

This commit is contained in:
2026-08-24 19:24:29 +02:00
committed by duan_j
parent bdafc03963
commit c71676a29c
+11
View File
@@ -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()