test: cover merchant phase 5 delivery

This commit is contained in:
2026-09-02 02:51:58 +08:00
parent b5d7be7d28
commit f3be06a3e0
2 changed files with 77 additions and 11 deletions
@@ -22,7 +22,7 @@ test('phase-five module covers dispatch edit, transfer, PDA pick/depart and deli
for (const token of [
"const DISPATCH_BASE = '/api/platform/v1/last-leg/dispatches'",
"const PDA_DISPATCH_BASE = '/api/pda/v1/last-leg/dispatches'",
'/transfer-delivery', '/items/${encodeURIComponent(id(item.dispatchItemId))}/pick',
'query(MERCHANT_DELIVERY_BASE, { dispatchNo })', '/items/${encodeURIComponent(id(item.dispatchItemId))}/pick',
'/complete`', '/depart`', '/outbound-orders/${encodeURIComponent(outboundNo)}',
'/delivery-orders/${encodeURIComponent(deliveryNo)}/status',
]) assert.ok(source.includes(token), token)
@@ -33,6 +33,23 @@ test('phase-five module covers dispatch edit, transfer, PDA pick/depart and deli
assert.match(source, /DELIVERING/)
})
test('phase-five module proves the client delivery create, list and nested detail contract', () => {
assert.match(source, /const MERCHANT_DELIVERY_BASE = '\/api\/merchant\/v1\/last-leg\/delivery-orders'/)
assert.match(source, /loginMerchant\(context, customerId\)/)
assert.match(source, /context\.options\?\.merchantUsername/)
assert.match(source, /\/api\/merchant\/v1\/iam\/tenant\/profile/)
assert.match(source, /id\(profile\?\.id\) === customerId/)
assert.match(source, /客户创建派送并原子转出库单/)
assert.match(source, /deliveryMethod: 'TRUCK_PALLET'/)
assert.match(source, /fees: \[\{ feeType: 'DELIVERY_FEE', currency: 'USD', amount: 10/)
assert.match(source, /客户分页回查自身派送单/)
assert.match(source, /客户读取自身派送详情/)
assert.match(source, /merchantDetail\.data\?\.order\?\.deliveryNo/)
assert.match(source, /merchantDetail\.data\?\.skus/)
assert.match(source, /merchantDetail\.data\?\.fees/)
assert.match(source, /merchantDetail\.data\?\.operations/)
})
test('phase-five module proves completion, customer visit, manual exception and delivery return', () => {
for (const token of [
'/delivery-orders/${encodeURIComponent(deliveryNo)}/complete',
@@ -51,7 +68,7 @@ test('phase-five module uses marker-owned fixtures and always disables its tempo
assert.match(source, /resolvePickerAccess\(context\)/)
assert.match(source, /createPicker\(context, 5, warehouseId, access\)/)
assert.match(source, /finally \{[\s\S]*disablePicker\(context, picker, 5\)[\s\S]*picker\.token = null/)
assert.doesNotMatch(source, /8\.163\.|password\s*:/)
assert.doesNotMatch(source, /8\.163\.|password\s*:\s*['"`]/)
})
test('phase-five writes carry idempotency and record deployment blockers instead of passing empty fixtures', () => {