fix(pda): enforce cabinet evidence contract

This commit is contained in:
2026-08-10 11:53:43 +08:00
parent 5983fad266
commit fc1944fb7e
3 changed files with 93 additions and 26 deletions
+11 -1
View File
@@ -11,7 +11,7 @@ test('PDA loading adapter keeps C04 read and write paths', () => {
'/loading/picking?tenantId=',
'/loading/picking/start?tenantId=',
'/loading/picking/complete?tenantId=',
'/loading/evidence?tenantId=',
'/loading/evidence/pda?tenantId=',
'/loading/complete?tenantId='
]) assert.match(source, new RegExp(path.replace(/[?]/g, '\\?')))
assert.match(source, /'Idempotency-Key'/)
@@ -19,6 +19,8 @@ test('PDA loading adapter keeps C04 read and write paths', () => {
for (const label of ['空仓照片', '半仓照片', '满仓照片', '锁仓照片', '带锁码照']) assert.match(source, new RegExp(label))
assert.match(source, /uni\.uploadFile/)
assert.match(source, /\/files\/loading-evidence\//)
assert.match(source, /loading\/evidence\/pda\?tenantId=/)
assert.match(source, /loading\/evidence\/\$\{encodeURIComponent\(evidenceId\)\}\/void\/pda\?tenantId=/)
})
test('PDA adapter does not treat non-200 response bodies or network failures as success', () => {
@@ -46,6 +48,11 @@ test('picking page exposes five evidence slots, retry and remote completion stat
assert.match(page, /uploadEvidenceFile/)
assert.match(page, /submitting \|\| completedBoxes\[currentBoxIndex\]/)
assert.match(page, /completePicking\(/)
assert.match(page, /sourceType: \['camera'\]/)
assert.doesNotMatch(page, /sourceType: \['camera', 'album'\]/)
assert.match(page, /evidenceEntries\(slot\.type\)/)
assert.match(page, /voidEvidencePhoto\(/)
assert.match(page, /evidenceComplete/)
})
test('PDA cabinet picking adapter exposes online claim and item action contracts', () => {
@@ -59,4 +66,7 @@ test('PDA cabinet picking adapter exposes online claim and item action contracts
assert.match(page, /claimContainerPickingTask\(/)
assert.match(page, /submitContainerPickingBatch\(/)
assert.match(page, /任务版本已变化,请刷新后重试/)
assert.match(source, /locationIds: action\.locationIds \|\| \[\]/)
assert.match(page, /availablePickQuantity/)
assert.match(page, /库存\/库位可用量不足/)
})