优化
This commit is contained in:
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { run } from './finance-full-fixtures.mjs'
|
||||
import { buildContainerCostBody, run } from './finance-full-fixtures.mjs'
|
||||
|
||||
const here = path.dirname(fileURLToPath(import.meta.url))
|
||||
const source = fs.readFileSync(path.join(here, 'finance-full-fixtures.mjs'), 'utf8')
|
||||
@@ -204,6 +204,13 @@ test('fixture creates four real receivable manual sources before payable source'
|
||||
})
|
||||
|
||||
test('container cost uses loading plan identity and verifies snapshot fields before Finance', () => {
|
||||
const body = buildContainerCostBody('RUN-1', '2088073097986560001',
|
||||
{ loadingPlanId: '2088073275689709570' }, '2088073280000000001')
|
||||
assert.equal(body.customerId, '2088073097986560001')
|
||||
assert.equal(body.containerId, '2088073275689709570')
|
||||
assert.equal(JSON.parse(JSON.stringify(body)).customerId, '2088073097986560001')
|
||||
assert.match(source, /customerId: String\(customerId\)/)
|
||||
assert.doesNotMatch(source, /customerId: Number\(customerId\)/)
|
||||
assert.match(source, /containerId: String\(container\.loadingPlanId\)/)
|
||||
assert.doesNotMatch(source, /containerId: Number\(container\.loadingPlanId\)/)
|
||||
assert.match(source, /smart-loading\/plans\/\$\{encodeURIComponent\(container\.loadingPlanId\)\}/)
|
||||
|
||||
Reference in New Issue
Block a user