feat(ui): show verified per-reference replacement results
This commit is contained in:
1 parent
159616ea4a
commit
136d7ffd67
8 files changed
+262
-16
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
os.environ.setdefault('QT_QPA_PLATFORM', 'offscreen')
|
||||
|
||||
from dx_productivity.trial_task_center.logging_setup import append_task_event
|
||||
from test_ui_remediation import window
|
||||
|
||||
|
||||
def test_results_use_executed_readback_and_clear_when_switching_tasks(window, qtbot):
|
||||
task = window.service.create_task('Executed')
|
||||
for state, ref in [('saved_ok', 'R1'), ('batch_failed', 'R2'), ('no_match', 'R3')]:
|
||||
append_task_event(window.service._logging, level='INFO', task_id=task.task_id,
|
||||
operation='quick_run_executed', message=f'Replacements: {ref} OLD -> ACTUAL Saved, reopened',
|
||||
details={'state': state, 'schematic_name': 'MAIN', 'sheet_number': '1'})
|
||||
window.open_task(task.task_id)
|
||||
qtbot.waitUntil(lambda: not window._loading and not window._context_query.busy)
|
||||
window._show_task_log()
|
||||
qtbot.waitUntil(lambda: not window._log_presenter.query.busy)
|
||||
results = window.run_panel.result_view
|
||||
assert results.rowCount() == 1
|
||||
assert results.item(0, 1).text() == 'R1'
|
||||
assert results.item(0, 3).text() == 'ACTUAL'
|
||||
assert '已保存并核验' in results.item(0, 4).text()
|
||||
other = window.service.create_task('Unexecuted')
|
||||
window.open_task(other.task_id)
|
||||
qtbot.waitUntil(lambda: not window._loading and not window._context_query.busy)
|
||||
assert results.rowCount() == 0
|
||||
@@ -54,3 +54,13 @@ def test_completed_context_does_not_force_log_open(window):
|
||||
context = replace(context, task=replace(context.task, status=TaskStatus.COMPLETED), phase='complete')
|
||||
window._apply_task_context(context)
|
||||
assert not window.run_panel.toggle_log_button.isChecked()
|
||||
|
||||
|
||||
def test_bom_header_failure_is_visible_even_without_data_rows(qtbot):
|
||||
owner = SimpleNamespace(_update_gates=lambda: None, service=SimpleNamespace(target_plan=lambda _: ()))
|
||||
panel = ProjectPlanPanel(owner)
|
||||
qtbot.addWidget(panel)
|
||||
panel.bind_task('a')
|
||||
panel._received_bom_report(BomImportReport((), (), errors=('Excel 第 1 行:表头无效',)))
|
||||
assert '未通过' in panel.report_toggle.text()
|
||||
assert '表头无效' in panel.bom_report.toPlainText()
|
||||
Reference in new issue
Block a user