优化
This commit is contained in:
@@ -21,8 +21,8 @@ test('fixture covers weight, volume, manual order, and container allocation cont
|
||||
})
|
||||
|
||||
test('fee writes use verified Firstleg paths and do not fabricate historical IDs', () => {
|
||||
assert.match(source, /\/api\/platform\/v1\/inbounds\/.*fee-details\?accountId=/)
|
||||
assert.match(source, /\/api\/platform\/v1\/loading-plans\/.*fee-details\?accountId=/)
|
||||
assert.match(source, /listPath = `\$\{basePath\}\?accountId=/)
|
||||
assert.match(source, /const basePath = `\/api\/platform\/v1\/loading-plans\//)
|
||||
assert.match(source, /sourceType: detail\?\.sourceType \|\| 'MANUAL'/)
|
||||
assert.match(source, /created\?\.marker === context\.marker/)
|
||||
assert.match(source, /\/fees`/)
|
||||
@@ -91,13 +91,15 @@ test('run behavior emits consumer shape, both billing bases, distinct dates, sup
|
||||
assert.equal(fixture.orders[0].waybillId, 'WB-1')
|
||||
assert.equal(fixture.orders[0].actualWeightKg, 12.5)
|
||||
assert.equal(fixture.orders[0].totalVolumeCbm, 0.072)
|
||||
assert.deepEqual(new Set(fixture.feeSources.map((item) => item.billingBasis).filter((value) => value !== 'MANUAL_ORDER_FEE')),
|
||||
assert.deepEqual(new Set(fixture.feeSources.map((item) => item.billingBasis).filter((value) => ['WEIGHT_KG', 'VOLUME_CBM'].includes(value))),
|
||||
new Set(['WEIGHT_KG', 'VOLUME_CBM']))
|
||||
assert.ok(new Set(fixture.feeSources.map((item) => item.businessDate)).size >= 2)
|
||||
assert.equal(fixture.supplier.supplierId, 'PARTNER-1')
|
||||
assert.equal(fixture.supplier.supplierName, '往来单位一')
|
||||
assert.equal(fixture.voucherFileId, 'VOUCHER-1')
|
||||
assert.ok(Array.isArray(fixture.allocations))
|
||||
assert.ok(fixture.feeSources.filter((item) => item.direction === 'RECEIVABLE').length >= 4)
|
||||
assert.ok(new Set(fixture.feeSources.filter((item) => item.direction === 'RECEIVABLE').map((item) => item.businessDate)).size >= 2)
|
||||
})
|
||||
|
||||
test('run behavior preserves null IDs and deployment blockers when supplier, voucher and container are unavailable', async () => {
|
||||
@@ -113,3 +115,16 @@ test('run behavior preserves null IDs and deployment blockers when supplier, vou
|
||||
assert.ok(context.steps.some((step) => step.deploymentBlocker && step.name.includes('往来单位')))
|
||||
assert.ok(context.steps.some((step) => step.deploymentBlocker && step.name.includes('voucherFileId')))
|
||||
})
|
||||
|
||||
test('manual fee approval path keeps accountId as a query parameter', () => {
|
||||
assert.match(source, /basePath = `\/api\/platform\/v1\/inbounds\/.*fee-details`/)
|
||||
assert.match(source, /\$\{basePath\}\/\$\{feeId\}\/approve\?accountId=/)
|
||||
assert.doesNotMatch(source, /fee-details\?accountId=\$\{encodeURIComponent\(resource\.tenantId\)\}`\)/)
|
||||
})
|
||||
|
||||
test('fixture creates four real receivable manual sources before payable source', () => {
|
||||
assert.match(source, /const receivableResources = measured\.slice\(0, 4\)/)
|
||||
assert.match(source, /feeItems\.RECEIVABLE, 'RECEIVABLE'/)
|
||||
assert.match(source, /'MANUAL_RECEIVABLE'/)
|
||||
assert.match(source, /dateOffset\(-1 - \(index % 2\)\)/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user