0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 11:11:49 +02:00

feat: add clickable label util

This commit is contained in:
2025-06-03 08:56:51 +02:00
committed by David Perl
parent 594912136e
commit 2dda58f7d2
5 changed files with 26 additions and 4 deletions

View File

@ -77,7 +77,8 @@ def test_update_event_captured(device_browser, qtbot):
def test_device_item_expansion(device_browser, qtbot):
"""
Test that the form is displayed when the item is expanded
Test that the form is displayed when the item is expanded, and that the expansion is triggered
by clicking on the expansion button, the title, or the device icon
"""
device_item: QListWidgetItem = device_browser.ui.device_list.itemAt(0, 0)
widget: DeviceItem = device_browser.ui.device_list.itemWidget(device_item)
@ -90,6 +91,12 @@ def test_device_item_expansion(device_browser, qtbot):
qtbot.mouseClick(widget._expansion_button, Qt.MouseButton.LeftButton)
assert not widget.expanded
qtbot.mouseClick(widget._title, Qt.MouseButton.LeftButton)
qtbot.waitUntil(lambda: widget.expanded, timeout=500)
qtbot.mouseClick(widget._title_icon, Qt.MouseButton.LeftButton)
qtbot.waitUntil(lambda: not widget.expanded, timeout=500)
def test_device_item_mouse_press_and_move_events_creates_drag(device_browser, qtbot):
"""