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>
32 lines
1.1 KiB
Python
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"
|