fix: stabilize ICDB preflight and organize UI into tabs
This commit is contained in:
1 parent
29959e2988
commit
223655fe00
10 files changed
+352
-57
No files matched your search
@@ -0,0 +1,33 @@
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
|
||||
def test_three_horizontal_sections_keep_one_catalog_and_only_their_actions(qtbot, tmp_path, monkeypatch):
|
||||
from test_ui_filters import load_window
|
||||
window = load_window(qtbot, tmp_path, monkeypatch)
|
||||
window.show()
|
||||
assert [window.section_tabs.tabText(i) for i in range(window.section_tabs.count())] == [
|
||||
'检验', 'ICDB 维护', '中心库管理']
|
||||
window.search_edit.setText('Beta')
|
||||
window.select_visible_button.click()
|
||||
for index, visible, hidden in (
|
||||
(0, window.batch_button, window.icdb_repair_button),
|
||||
(1, window.icdb_repair_button, window.add_button),
|
||||
(2, window.add_button, window.batch_button),
|
||||
):
|
||||
window.section_tabs.setCurrentIndex(index)
|
||||
assert visible.isVisible() and not hidden.isVisible()
|
||||
assert window.cbb_table.isVisible()
|
||||
assert window.search_edit.text() == 'Beta'
|
||||
assert [record.name for record in window.selected_records()] == ['Beta']
|
||||
assert window.minimumSizeHint().height() <= 650
|
||||
|
||||
|
||||
def test_long_status_does_not_expand_the_window(qtbot, tmp_path):
|
||||
from cbb_refresh_verify.ui.main_window import MainWindow
|
||||
window = MainWindow(data_root=tmp_path)
|
||||
qtbot.addWidget(window)
|
||||
window.resize(1000, 650); window.show()
|
||||
window.status_label.setText('错误说明\n' * 80)
|
||||
qtbot.wait(20)
|
||||
assert window.height() <= 650
|
||||
assert window.status_label.height() <= window.status_label.fontMetrics().lineSpacing() * 3 + 4
|
||||
Reference in new issue
Block a user