Files
AareDAQ/tests/unit/gui/test_log_panel.py
duan_jandClaude Fable 5 e457236777 feat: merge Automation progress and Console log into one Information dock
The two tabified bottom docks left their switcher tabs stranded at the
window bottom; one Information dock with proper tabs mirrors the Sample
List dock's layout. LogDock becomes the LogPanel widget with mirror
views for the pop-out and a reveal_requested signal so the owner
controls visibility (Ctrl+Shift+L, notifications).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 10:35:55 +02:00

32 lines
1.1 KiB
Python

"""A log mirror view is a second view on the same emitter: history is copied
on creation, live lines reach both views, and clear() empties them all."""
from aare.gui.panels.log_panel import LogPanel
def test_log_mirror_view_and_clear(qtbot):
panel = LogPanel()
qtbot.addWidget(panel)
panel.emitter.message.emit("first line")
assert "first line" in panel.view.toPlainText()
mirror = panel.make_mirror_view()
qtbot.addWidget(mirror)
# History copied on creation, live lines reach both views.
assert "first line" in mirror.toPlainText()
panel.emitter.message.emit("second line")
assert "second line" in panel.view.toPlainText()
assert "second line" in mirror.toPlainText()
panel.clear()
assert panel.view.toPlainText() == ""
assert mirror.toPlainText() == ""
def test_notification_requests_reveal(qtbot):
panel = LogPanel()
qtbot.addWidget(panel)
with qtbot.waitSignal(panel.reveal_requested, timeout=1000):
panel.show_notification(title="Boom", message="it broke")
assert panel.notification._title.text() == "Boom"