更新派送自动完成测试验收

This commit is contained in:
2026-09-15 12:07:10 +08:00
parent c1f01e1e87
commit 6e35993e61
3 changed files with 179 additions and 54 deletions
@@ -25,7 +25,7 @@ test('phase-five module covers dispatch edit, transfer, PDA pick/depart and deli
"const PDA_DISPATCH_BASE = '/api/pda/v1/last-leg/dispatches'",
'query(MERCHANT_DELIVERY_BASE, { dispatchNo })', '/items/${encodeURIComponent(id(item.dispatchItemId))}/pick',
'/complete`', '/depart`', '/outbound-orders/${encodeURIComponent(outboundNo)}',
'/delivery-orders/${encodeURIComponent(deliveryNo)}/status',
'/delivery-orders/${encodeURIComponent(currentNo)}/status',
]) assert.ok(source.includes(token), token)
assert.match(source, /WAIT_OUTBOUND/)
assert.match(source, /WAIT_DELIVERY/)
@@ -33,7 +33,9 @@ test('phase-five module covers dispatch edit, transfer, PDA pick/depart and deli
assert.match(source, /OUTBOUNDED/)
assert.match(source, /DELIVERING/)
assert.match(source, /expectedVersion: deliveryVersion/)
assert.match(source, /status: 'DELIVERED', expectedVersion: completeVersion/)
assert.match(source, /transferDeliveries\(transferred\.data\)/)
assert.match(source, /new Set\(destinationKeys\)\.size === deliveries\.length/)
assert.match(source, /deliveries\.reduce\(\(sum, value\) => sum \+ Number\(value\?\.packageCount \|\| 0\), 0\)/)
})
test('phase-five module proves the client delivery create, list and nested detail contract', () => {
@@ -53,9 +55,10 @@ test('phase-five module proves the client delivery create, list and nested detai
assert.match(source, /merchantDetail\.data\?\.operations/)
})
test('phase-five module proves completion, customer visit, manual exception and delivery return', () => {
test('phase-five module proves receipt-save completion, cross-region convergence, customer visit, exception and return', () => {
for (const token of [
'/delivery-orders/${encodeURIComponent(deliveryNo)}/complete',
'/documents/RECEIPT/files', 'requestOverseasMultipart', "category: 'RECEIPT'",
'SAVE-RECEIPT', 'RECEIPT_AUTO_COMPLETE',
'/customer-visits/${encodeURIComponent(visitId)}',
"visitResult: 'SATISFIED'", '/exception-orders',
'/return-inbound-options', '/mark-return', "returnDirection: 'OVERSEAS_WAREHOUSE'",
@@ -64,6 +67,15 @@ test('phase-five module proves completion, customer visit, manual exception and
"idempotencyKey: key(context, 'DELIVERY-RETURN')", '派送退回同键同载荷重放',
'RETURN_PENDING_WITH_COMPLETED_VISIT',
]) assert.ok(source.includes(token), token)
assert.match(source, /saved\.data\?\.categories\?\.some/)
assert.match(source, /completed\.data\?\.order\?\.status === 'DELIVERED'/)
assert.match(source, /人工确认派送完成接口已移除/)
assert.match(source, /query\('\/api\/platform\/inbounds'/)
assert.match(source, /inboundCode: inbound\.inboundCode/)
assert.match(source, /inboundSummary\?\.processStatus === 'DELIVERED'/)
assert.match(source, /\/api\/platform\/v1\/orders\/\$\{encodeURIComponent\(sourceOrderId\)\}/)
assert.match(source, /mainStatus === 'COMPLETED'/)
assert.doesNotMatch(source, /platform\(context, 'POST', '确认派送完成/)
assert.match(source, /manualExceptionNo/)
assert.match(source, /returnExceptionNo/)
})