From 034da6e1362d0b80c0137de768a7b592c39208be Mon Sep 17 00:00:00 2001 From: Saberlve Date: Wed, 15 Apr 2026 16:08:07 +0800 Subject: [PATCH] test(import-window): update UI tests for floating window Updates test assertions to match new window IDs and function names: - import-window-shell, window-minimize-button, window-maximize-button, window-close-button, window-restore-button, import-window-minimized-bar - window-project-label, window-collection-tree, window-collection-items - window-selected-count, window-clear-selection-button - window-import-selected-items-button - isImportWindowOpen, openImportWindow, closeImportWindow - New window management functions in CSS and JS Co-Authored-By: Claude Opus 4.6 --- tests/test_ui.py | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/tests/test_ui.py b/tests/test_ui.py index 2eb2397..ac21368 100644 --- a/tests/test_ui.py +++ b/tests/test_ui.py @@ -26,21 +26,42 @@ def test_index_contains_base_page_forms(tmp_path) -> None: assert 'id="plan-form"' in html -def test_index_contains_import_modal_controls(tmp_path) -> None: +def test_index_contains_import_window_controls(tmp_path) -> None: html = _get_index_html(tmp_path) assert 'id="open-import-modal-button"' in html - assert 'id="import-modal"' in html - assert 'id="close-import-modal-button"' in html - assert 'id="modal-collection-tree"' in html - assert 'id="modal-collection-items"' in html - assert 'id="modal-selected-count"' in html - assert 'id="modal-select-descendants-button"' in html - assert 'id="modal-clear-selection-button"' in html - assert 'id="modal-import-selected-items-button"' in html + assert 'id="import-window-shell"' in html + assert 'id="window-minimize-button"' in html + assert 'id="window-maximize-button"' in html + assert 'id="window-close-button"' in html + assert 'id="window-restore-button"' in html + assert 'id="import-window-minimized-bar"' in html + assert 'id="window-project-label"' in html + assert 'id="window-collection-tree"' in html + assert 'id="window-collection-items"' in html + assert 'id="window-selected-count"' in html + assert 'id="window-clear-selection-button"' in html + assert 'id="window-import-selected-items-button"' in html assert 'id="item-preview-popover"' in html - assert 'isImportModalOpen: false' in html - assert "function openImportModal()" in html - assert "function closeImportModal()" in html + assert 'isImportWindowOpen: false' in html + assert "function openImportWindow()" in html + assert "function closeImportWindow()" in html assert "function updateImportActionState()" in html assert 'document.body.classList.toggle("modal-open"' in html + + +def test_index_window_frame_css(tmp_path) -> None: + html = _get_index_html(tmp_path) + + assert ".window-frame" in html + assert ".window-shell" in html + assert ".window-toolbar" in html + assert ".window-body" in html + assert ".window-minimized-bar" in html + assert '"zotero-kb.import-window"' in html + assert "startWindowDrag" in html + assert "minimizeWindow" in html + assert "maximizeWindow" in html + assert "restoreWindow" in html + assert "initWindowFromSession" in html + assert "persistWindowSessionState" in html