test: prepare isolated gray domestic PDA H5 tasks without auto-picking

This commit is contained in:
2026-10-09 17:21:56 +08:00
parent 023b28e31f
commit 74bf0e73c5
7 changed files with 53 additions and 2 deletions
@@ -136,3 +136,16 @@ test('booking fixture never invents supplier names without formal IDs', () => {
assert.doesNotMatch(source, /SPLIT-SHIPPING|SPLIT-AGENT/)
assert.doesNotMatch(source, /shippingCompanyName: `|bookingAgentName: `/)
})
test('H5 preparation stops after real labels but before claim and refuses already picked data', () => {
const checkpoint = source.indexOf('if (context.context?.prepareDomesticPdaH5)')
const claim = source.indexOf('const claim = await request', checkpoint)
assert.ok(checkpoint > source.indexOf('const labelResponse ='))
assert.ok(claim > checkpoint)
const boundary = source.slice(checkpoint, claim)
assert.match(boundary, /pickedPackageCount\) !== 0/)
assert.match(boundary, /throw new Error/)
assert.match(boundary, /return \{ preparedForH5: true/)
assert.doesNotMatch(boundary, /request\(/)
})