test(firstleg): add mixed container customs acceptance
This commit is contained in:
@@ -15,6 +15,8 @@ import {
|
||||
} from './container-customs-acceptance-matrix.mjs'
|
||||
|
||||
const source = readFileSync(new URL('./phase3-container-customs.mjs', import.meta.url), 'utf8')
|
||||
const fixtureSource = readFileSync(new URL('./phase3-container-customs-fixture.mjs', import.meta.url), 'utf8')
|
||||
const entrySource = readFileSync(new URL('../admin-test-env-acceptance.mjs', import.meta.url), 'utf8')
|
||||
|
||||
test('matrix covers three isolated LOADED container kinds', () => {
|
||||
assert.deepEqual(CONTAINER_CUSTOMS_FIXTURE_KINDS,
|
||||
@@ -26,9 +28,24 @@ test('matrix covers three isolated LOADED container kinds', () => {
|
||||
taxMode: kind === 'ALL_BUY_DECLARATION' ? 'BUY_DECLARATION' : 'TAX_REFUND' }],
|
||||
})) }
|
||||
assert.equal(validateContainerCustomsFixtures(fixtures, 'M'), true)
|
||||
assert.equal(validateContainerCustomsFixtures({ marker: 'M', containers: [fixtures.containers[2]] },
|
||||
'M', ['MIXED']), true)
|
||||
assert.equal(validateContainerCustomsFixtures({ ...fixtures, marker: 'OLD' }, 'M'), false)
|
||||
})
|
||||
|
||||
test('mixed fixture producer is registered and uses only public HTTP composition', () => {
|
||||
assert.match(entrySource, /CONFIGURED_MODULES[^\n]*'phase3-container-customs'/)
|
||||
assert.match(entrySource, /\['phase3-container-customs', \['merchant-qualification-fixture'\]\]/)
|
||||
assert.match(entrySource, /phase3-container-customs-fixture\.mjs/)
|
||||
assert.match(fixtureSource, /primary: 'BUY_DECLARATION', incremental: 'TAX_REFUND'/)
|
||||
assert.match(fixtureSource, /phase3-loading\.mjs/)
|
||||
assert.match(fixtureSource, /phase3-loading-finalize\.mjs/)
|
||||
assert.match(fixtureSource, /LOADING_LIST_BUY_DECLARATION_ITEMS/)
|
||||
assert.match(fixtureSource, /merchantQualificationFixture/)
|
||||
assert.doesNotMatch(fixtureSource, /customerToken:/)
|
||||
assert.doesNotMatch(fixtureSource, /\b(?:INSERT\s+INTO|DELETE\s+FROM|UPDATE\s+(?:fl_|ll_|wh_|ord_))/i)
|
||||
})
|
||||
|
||||
test('coverage matrix freezes every requested product boundary', () => {
|
||||
const text = CONTAINER_CUSTOMS_MATRIX.map((item) => `${item.scenario}:${item.expected}`).join('\n')
|
||||
for (const token of ['买单XLSX', '多对多', '覆盖', '改关联', '删除', '冻结', '逐份完成文件',
|
||||
@@ -51,6 +68,10 @@ test('HTTP scenario contains file, state, idempotency, concurrency and zero-drif
|
||||
'缺退税资料禁止开始且零漂移', '开始后资料范围锁定A0409零漂移',
|
||||
"['上传'", "['覆盖'", "['改关联'", "['删除'", '开始后${label}锁定A0409零漂移',
|
||||
'最后一份完成文件前禁止整柜完成', '最后一份完成文件后纯退税柜完成',
|
||||
'混合柜平台详情精确包含BUY与TAX长ID票', 'Client只见本客户TAX票且完全隐藏BUY票',
|
||||
'买单导出只处理实际装柜BUY行', '混合柜最后一份完成文件后整柜COMPLETED',
|
||||
'自动离仓只写一次SYSTEM历史', '自动离仓只创建一个OUTBOUND_CONFIRM长ID任务',
|
||||
'已停止后续完成写入并保留现场',
|
||||
'自动离仓失败不回滚报关完成', '自动或待条件重试后整柜单次离仓',
|
||||
'同幂等键异载荷A0409', 'Promise.all', 'requestId=', 'traceId=', 'xlsxMagic']) {
|
||||
assert.match(source, new RegExp(token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
|
||||
|
||||
Reference in New Issue
Block a user