test: normalize finance container allocation sources
This commit is contained in:
@@ -46,7 +46,8 @@ function fakeContext(withFixture = true, permissions = financePermissions, denyF
|
||||
const fixture = { marker, customerId: '11',
|
||||
orders: feeSources.filter((item) => item.orderId)
|
||||
.map((item) => ({ orderId: item.orderId, shipmentId: `SHIP-${item.orderId}` })),
|
||||
feeSources: feeSources.map((item) => ({ ...item, marker })) }
|
||||
feeSources: feeSources.map((item) => ({ ...item, customerId: '11',
|
||||
waybillId: item.orderId ? `SHIP-${item.orderId}` : null, marker })) }
|
||||
const statements = new Map()
|
||||
const settlements = new Map()
|
||||
const idempotency = new Map()
|
||||
@@ -287,6 +288,18 @@ test('PAYABLE 接受 partnerId 及名称快照,不依赖 SUPPLIER 类型', asy
|
||||
assert.doesNotMatch(source, /partnerType|types\?\.includes|SUPPLIER.*阻断/)
|
||||
})
|
||||
|
||||
test('来源缺失逐条 customerId 时不得由 fixture 根字段静默补齐', async () => {
|
||||
const context = fakeContext()
|
||||
delete context.createdResources.financeFullFixtures.feeSources[0].customerId
|
||||
|
||||
await run(context)
|
||||
|
||||
assert.equal(context.steps.some((step) => step.name === 'Fixture 来源契约完整'
|
||||
&& !step.passed && step.deploymentBlocker), true)
|
||||
assert.equal(context.coverageGaps.some((gap) => gap.category === 'invalid-finance-fixture-contract'), true)
|
||||
assert.equal(context.calls.some((call) => call.method !== 'GET'), false)
|
||||
})
|
||||
|
||||
test('缺少 Finance 创建权限时 fail-closed 且不发送财务写请求', async () => {
|
||||
const context = fakeContext(true, financePermissions.filter((item) => item !== 'platform:finance:reconciliation:create'))
|
||||
await run(context)
|
||||
|
||||
Reference in New Issue
Block a user