优化
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { matchesManualScheduleScope } from './phase3-carrier-schedule-queries.mjs'
|
||||
|
||||
const expected = { customerId: '10001', oceanBookingId: '20001', containerBookingId: null }
|
||||
|
||||
test('does not reuse a schedule from the same booking when the container scope differs', () => {
|
||||
assert.equal(matchesManualScheduleScope({
|
||||
id: '30001', customerId: '10001', oceanBookingId: '20001', containerBookingId: '40001',
|
||||
}, expected), false)
|
||||
})
|
||||
|
||||
test('does not reuse a schedule whose customer scope is unknown', () => {
|
||||
assert.equal(matchesManualScheduleScope({
|
||||
id: '30001', oceanBookingId: '20001', containerBookingId: null,
|
||||
}, expected), false)
|
||||
})
|
||||
|
||||
test('reuses a schedule only when customer, booking and container scopes all match', () => {
|
||||
assert.equal(matchesManualScheduleScope({
|
||||
id: '30001', customerId: 10001, oceanBookingId: 20001, containerBookingId: null,
|
||||
}, expected), true)
|
||||
})
|
||||
Reference in New Issue
Block a user