test(loading): scope non-ISO HTTP verification without removal probes

This commit is contained in:
2026-10-23 11:19:36 +08:00
parent 9c19980736
commit ecc76d4f91
4 changed files with 24 additions and 2 deletions
@@ -3,6 +3,7 @@ import { readFileSync } from 'node:fs'
import test from 'node:test'
import { controlledPhotoDownload } from './phase3-container-overview.mjs'
import { parseArguments, validateExecutionOptions } from '../admin-test-env-acceptance.mjs'
const read = (path) => readFileSync(new URL(path, import.meta.url), 'utf8')
const overviewOpenApi = read('../../firstleg/src/main/resources/openapi/phase3-container-overview-v1.yaml')
@@ -24,6 +25,18 @@ const phase3LoadingAcceptance = read('phase3-loading.mjs')
const truckAcceptance = read('truck-appointments.mjs')
const matrix = read('../../../docs/国内货柜履约/归档/货柜管理全链验收矩阵-2026-08-13.md')
test('non-ISO HTTP scope excludes unrelated deletion probes and keeps non-ISO completion facts', () => {
const options = parseArguments(['--modules', 'phase3-container-loading', '--verify-non-iso-container', 'true',
'--gateway', 'https://acceptance.invalid', '--username', 'test', '--password', 'test',
'--pda-username', 'pda', '--pda-password', 'test'])
assert.equal(validateExecutionOptions(options).verifyNonIsoContainer, true)
assert.throws(() => validateExecutionOptions({ ...options, verifyPalletLocationGuide: true }), /删除探针/)
assert.throws(() => validateExecutionOptions({ ...options, requestedModules: ['phase3-loading'] }), /单独柜号链/)
assert.match(containerLoadingAcceptance, /const realContainerNo = 'JZXH10231043'/)
assert.match(containerLoadingAcceptance, /const replacementContainerNo = `TEST-\$\{context.marker\}-NOISO`/)
assert.match(containerLoadingAcceptance, /if \(context.options\?\.verifyNonIsoContainer\)[\s\S]*?addCoverageGap[\s\S]*?else if \(!channelIsolation.pair\)/)
})
test('container acceptance reads the canonical domestic workbench route', () => {
assert.match(containerLoadingAcceptance, /const DOMESTIC_CONTAINERS = `\$\{CONTAINERS\}\/domestic`/)
assert.match(containerLoadingAcceptance, /function containerRecord\(value\) \{ return value\?\.container \}/)