From e820c106afdb8f339c647a5afb9a9ebccf7a7596 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sat, 13 Jun 2026 12:36:08 +0200 Subject: [PATCH] test: structure tests for control-deck side-by-side mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_deck_stack_exists: _deck_stack present; default shows _control_deck. - test_pinning_two_panels_switches_to_split: pin 2 panels + refresh → stack shows _deck_split_container. Pin via _pinned flags directly (not the toggle handler) so no QSettings write leaks into other function-scoped windows; existing 6 tests run in default/tabbed state and still pass. Co-Authored-By: Claude Fable 5 --- tests/test_ui_structure.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_ui_structure.py b/tests/test_ui_structure.py index de8b856..8f29702 100644 --- a/tests/test_ui_structure.py +++ b/tests/test_ui_structure.py @@ -54,3 +54,19 @@ def test_menu_only_buttons_not_in_deck(win): assert win._btn_train not in deck_btns assert win._btn_scan_all not in deck_btns assert win._btn_hide_subcats not in deck_btns + + +def test_deck_stack_exists(win): + # The deck is wrapped in a stack so it can swap tabbed <-> side-by-side. + # Default (nothing pinned) shows the tabbed control deck. + assert win._deck_stack is not None + assert win._deck_stack.currentWidget() is win._control_deck + + +def test_pinning_two_panels_switches_to_split(win): + # Pin two panels directly (avoid the toggle handler so no QSettings write + # leaks into other test windows) and refresh. + win._tab_export._pinned = True + win._tab_crop._pinned = True + win._refresh_deck_layout() + assert win._deck_stack.currentWidget() is win._deck_split_container