test: confirm plans before PDA acceptance

This commit is contained in:
2026-08-15 17:40:01 +08:00
parent 05921eca13
commit 28daf15082
6 changed files with 172 additions and 8 deletions
@@ -21,6 +21,19 @@ test('retains all clickable container, loading-list and PDA workflow states thro
const pushIndex = source.indexOf('`${SMART}/plans/${plan.id}/push-preload`')
const transportIndex = source.indexOf('`${CONTAINERS}/${containerId}/transport`')
assert.ok(transportIndex >= 0 && pushIndex > transportIndex)
const unconfirmedTaskIndex = source.indexOf('`${PDA}/tasks?loadingPlanId=${planId}&warehouseId=${source.warehouseId}`', pushIndex)
const confirmIndex = source.indexOf('`${LOADING}/loading-plans/${planId}/confirm`', unconfirmedTaskIndex)
const canonicalTaskIndex = source.indexOf('`${PDA}/tasks?loadingPlanId=${planId}&warehouseId=${source.warehouseId}`', unconfirmedTaskIndex + 1)
assert.ok(unconfirmedTaskIndex > pushIndex && confirmIndex > unconfirmedTaskIndex
&& canonicalTaskIndex > confirmIndex)
assert.match(source, /计划确认前不生成 PDA 任务/)
assert.match(source, /summary\?\.readiness\?\.canConfirm === true/)
assert.match(source, /Object\.freeze\(\{ expectedVersion: confirmableVersion \}\)/)
assert.match(source, /confirmationStatus === 'CONFIRMED'/)
assert.match(source, /readiness\?\.readyForPda === true/)
assert.match(source, /id\(task\?\.id\) !== confirmedTaskId/)
assert.match(source, /计划确认同键同参精确重放/)
assert.doesNotMatch(source, /\/preload\/confirming|\/preload\/confirm\?tenantId=/)
assert.match(source, /transported\?\.cabinetNo !== container\?\.cabinetNo/)
assert.match(source, /shippingCompanyId: null, shippingCompanyName: null/)
assert.match(source, /bookingAgentId: null, bookingAgentName: null/)