test: correct container loading acceptance order

This commit is contained in:
2026-08-14 21:45:54 +08:00
parent dbca4a1403
commit fdd011bc57
5 changed files with 75 additions and 16 deletions
@@ -61,3 +61,23 @@ test('test-environment full acceptance keeps assigned and unassigned customer bo
assert.match(bookingModule, /指定客户订舱持久化本轮客户范围快照/)
assert.match(bookingModule, /phase3Loading[\s\S]*phase3ContainerLoading/)
})
test('test-environment loading chains bind the latest container version before opening PDA', () => {
const containerLoading = readFileSync(
resolve(scriptsDir, 'admin-test-env-modules', 'phase3-container-loading.mjs'), 'utf8')
const bridgeLoading = readFileSync(
resolve(scriptsDir, 'admin-test-env-modules', 'phase3-loading.mjs'), 'utf8')
assert.match(containerLoading, /version: Number\(linkedContainer\.version\), reason: context\.marker/)
const bridgeIndex = bridgeLoading.indexOf('原子关联入库预装与柜次装柜计划')
const rejectedPushIndex = bridgeLoading.indexOf('无真实柜号拒绝推送柜次计划')
const transportIndex = bridgeLoading.indexOf('绑定真实柜号后开放三期 PDA 推送门禁')
const successfulPushIndex = bridgeLoading.indexOf('绑定真实柜号后推送柜次计划并生成 PDA 任务')
const pdaIndex = bridgeLoading.indexOf('读取柜次级 PDA 唯一事实任务')
assert.ok(bridgeIndex >= 0 && rejectedPushIndex > bridgeIndex && transportIndex > rejectedPushIndex
&& successfulPushIndex > transportIndex && pdaIndex > successfulPushIndex)
assert.match(bridgeLoading, /const missingContainerPushRejected = failure\(missingContainerPushResponse\)[\s\S]*if \(!missingContainerPushRejected\) return/)
assert.match(bridgeLoading, /const missingContainerTaskAbsent =[\s\S]*if \(!missingContainerTaskAbsent\) return/)
assert.match(bridgeLoading, /version: transportVersion/)
})