优化
This commit is contained in:
@@ -71,7 +71,7 @@ function hookSet({ missing = false } = {}) {
|
||||
orderId: `O-${suffix}`, orderNo: `NO-${suffix}`, waybillId: suffix === 'AUTO1' ? 'WB-1' : null, inboundId: `I-${suffix}` }),
|
||||
measureOrder: async (context, resource) => ({ ...resource, measurementId: `M-${resource.orderId}`, actualWeightKg: 12.5, totalVolumeCbm: 0.072 }),
|
||||
loadFeeItem: async (context, direction) => ({ id: direction === 'PAYABLE' ? '902' : '901', status: 'ACTIVE' }),
|
||||
loadSupplier: async () => missing ? null : ({ id: 'PARTNER-1', partnerName: '往来单位一', status: 'ACTIVE' }),
|
||||
loadSupplier: async () => missing ? null : ({ id: 'SUPPLIER-1', name: '订舱供应商一', category: 'BOOKING', status: 'ACTIVE' }),
|
||||
uploadVoucher: async () => missing ? null : 'VOUCHER-1',
|
||||
verifyContainerCostSnapshotInput: async () => ({ valid: true, items: [{ accountId: '701', orderId: 'O-AUTO1', volumeCbm: 0.072 }] }),
|
||||
loadPublishedAutomaticFee: async (context, resource) => {
|
||||
@@ -104,8 +104,8 @@ test('run behavior emits consumer shape, both billing bases, distinct dates, sup
|
||||
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.supplier.supplierId, 'SUPPLIER-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)
|
||||
@@ -143,7 +143,7 @@ test('run behavior preserves null IDs and deployment blockers when supplier, vou
|
||||
assert.deepEqual(fixture.container, { containerBookingId: null, containerNo: null })
|
||||
assert.deepEqual(fixture.allocations, [])
|
||||
assert.ok(fixture.deploymentBlocker.length >= 3)
|
||||
assert.ok(context.steps.some((step) => step.deploymentBlocker && step.name.includes('往来单位')))
|
||||
assert.ok(context.steps.some((step) => step.deploymentBlocker && step.name.includes('供应商')))
|
||||
assert.ok(context.steps.some((step) => step.deploymentBlocker && step.name.includes('voucherFileId')))
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user