refactor(ui): remove obsolete project table and test-only cell adapter

This commit is contained in:
阿白叔 committed 2026-10-15 21:35:32 +08:00
1 parent 136d7ffd67
commit 6c0ca95d84
9 files changed
+9 -163

No files matched your search

+2 -1
View File
@@ -175,7 +175,8 @@ def test_ui_previews_each_project_and_confirms_the_batch_once(batch, tmp_path, q
window.open_task(tasks[1].task_id)
qtbot.waitUntil(lambda: not window._loading and not window._context_query.busy)
assert window.plan_panel.table.rows()[0].new_part_number == 'NEW-1'
window.plan_panel.table.item(0, 6).setText('EDITED-SECOND')
model = window.plan_panel.table.model()
model.setData(model.index(0, 6), 'EDITED-SECOND')
window.plan_panel.save_button.click()
qtbot.waitUntil(lambda: not window._workers and not window._loading and not window._context_query.busy,
timeout=5000)
+3 -3
View File
@@ -54,8 +54,8 @@ def test_original_window_edits_target_plan_and_nc_without_export(qtbot, tmp_path
qtbot.waitUntil(lambda: not window._loading and not window._context_query.busy)
assert '1.1.2' in window.windowTitle()
table = window.plan_panel.table
table.item(0, 0).setCheckState(Qt.CheckState.Checked)
table.item(0, 9).setCheckState(Qt.CheckState.Unchecked)
table.model().setData(table.model().index(0, 0), Qt.CheckState.Checked, Qt.ItemDataRole.CheckStateRole)
table.model().setData(table.model().index(0, 9), Qt.CheckState.Unchecked, Qt.ItemDataRole.CheckStateRole)
assert not window.run_panel.quick_run_button.isEnabled()
assert window.plan_panel.export_bom_button.isEnabled()
window.plan_panel.save()
@@ -68,7 +68,7 @@ def test_original_window_edits_target_plan_and_nc_without_export(qtbot, tmp_path
assert window.run_panel.quick_run_button.isEnabled()
assert not (tmp_path / 'plan.xlsx').exists()
# Switching tasks must not conceal an unsaved draft from group execution.
table.item(0, 6).setText('OTHER')
table.model().setData(table.model().index(0, 6), 'OTHER')
window.plan_panel.bind_task(None)
assert window.plan_panel.has_unsaved_plan((task.task_id,))
window._close_plan_confirmer = lambda: "discard"
+2 -2
View File
@@ -85,8 +85,8 @@ def test_header_sort_edit_and_bulk_actions_keep_uid_binding(qtbot):
table.populate(rows)
assert table.isSortingEnabled()
table.sortByColumn(3, Qt.SortOrder.AscendingOrder)
assert table.item(0, 3).text() == 'R1'
table.item(0, 6).setText('NEW-R1')
assert table.model().index(0, 3).data() == 'R1'
table.model().setData(table.model().index(0, 6), 'NEW-R1')
table.selectRow(1)
table.apply_to_selected('NEW-R2')
assert {r.target.uid: r.new_part_number for r in table.rows()} == {'u1': 'NEW-R1', 'u2': 'NEW-R2'}