test(admin): align phase3 loading producer contract

This commit is contained in:
2026-08-11 17:48:36 +08:00
parent a59f4634cd
commit cad2ba6e91
3 changed files with 26 additions and 9 deletions
@@ -70,7 +70,7 @@ test('container loading follows push, claim, real pick, completed sequence', ()
assert.match(value, /containerDetail\?\.planStatus === 'WAIT_LOADING'/)
assertOrder(value, [
"pushed?.status === 'EDITING'",
"claimedPlan?.status === 'EDITING'",
"claimedPlan?.status === 'LOADING'",
"const pickResponse = await request",
"finalPlan?.status === 'COMPLETED'",
])
@@ -80,10 +80,22 @@ test('bridge loading starts through a real PDA batch before preload confirmation
const value = source('./phase3-loading.mjs')
assertOrder(value, [
"pushedLoadingPlan?.status === 'EDITING'",
"claimedPlan?.status === 'EDITING'",
"claimedPlan?.status === 'LOADING'",
"const canonicalPick = await request",
"pickedPlan?.status === 'COMPLETED'",
"const confirming = await request",
])
assert.match(value, /confirmed\?\.mainStatus === 'LOADING' && confirmed\?\.preloadPlan\?\.status === 'CONFIRMING'/)
assert.match(value, /confirmed\?\.preloadPlan\?\.status === 'CONFIRMED'/)
assert.doesNotMatch(value, /关联柜次计划进入 LOADING/)
})
test('downstream producers prefer the phase3Loading container fixture', () => {
const ocean = source('./ocean-bookings.mjs')
const customs = source('./phase3-customs.mjs')
const serviceCenter = source('./service-center-flow.mjs')
assert.match(ocean, /context\.createdResources\?\.phase3Loading\s*\|\|\s*context\.createdResources\?\.phase3ContainerLoading/)
assert.match(customs, /createdResources\?\.phase3Loading,\s*\n\s*createdResources\?\.phase3ContainerLoading/)
assert.match(serviceCenter, /context\.createdResources\?\.phase3Loading\s*\|\|\s*context\.createdResources\?\.phase3ContainerLoading/)
assert.match(ocean, /await action\('放舱', 'release'/)
})