This commit is contained in:
2026-08-31 13:43:18 +08:00
parent 50a2e5082d
commit 410802870d
2 changed files with 19 additions and 0 deletions
+12
View File
@@ -103,6 +103,18 @@ test('completed detail overrides stale local state and an empty batch refreshes
assert.ok(perform.indexOf('if (!actions.length)') < perform.indexOf('submitContainerPickingBatch('))
})
test('successful batch submission automatically refreshes canonical item status before completion gates', () => {
const perform = page.match(/async performSubmit\([^)]*\) \{[\s\S]*?\n\t\t\t\},/)?.[0] || ''
const submitIndex = perform.indexOf('await submitContainerPickingBatch(')
const refreshIndex = perform.indexOf('await this.syncRemoteTask()', submitIndex)
const gateIndex = perform.indexOf('if (!this.pickingCompleted)', refreshIndex)
assert.ok(submitIndex >= 0 && refreshIndex > submitIndex, 'canonical detail should refresh after the accepted batch')
assert.ok(gateIndex > refreshIndex, 'completion should be evaluated only after the automatic refresh')
assert.match(perform, /拣货已提交,正在刷新最新状态/)
assert.match(perform, /拣货已提交,但最新任务状态尚未同步,请点击刷新任务/)
assert.match(perform, /if \(!this\.pickingCompleted\)[\s\S]*?return/)
})
test('final completion preserves backend gate errors and refreshes after an atomic A0409', () => {
const complete = page.match(/async completeLoadingTask\(\) \{[\s\S]*?\n\t\t\t\},/)?.[0] || ''
assert.match(complete, /this\.isTaskConflict\(error\)[\s\S]*?await this\.refreshAfterTaskConflict\(sanitizeUserMessage\(error\.message, '订舱、装柜关联或证据状态已变化,请刷新后重试'\)\)/)