22 lines
1.0 KiB
JavaScript
22 lines
1.0 KiB
JavaScript
import assert from 'node:assert/strict'
|
|
import { readFileSync } from 'node:fs'
|
|
import test from 'node:test'
|
|
const source = readFileSync(new URL('./manual-state-ocean-trucking.mjs', import.meta.url), 'utf8')
|
|
|
|
test('manual matrix retains only DRAFT and RELEASED ocean booking states', () => {
|
|
assert.match(source, /const OCEAN_LIST_STATUSES = \['DRAFT', 'RELEASED'\]/)
|
|
assert.match(source, /containerRequirements:/)
|
|
assert.doesNotMatch(source, /change-request|\/cancel/)
|
|
assert.doesNotMatch(source, /realContainerBookingId|containerNo:\s*`MAN-/)
|
|
assert.match(source, /status === 'DRAFT'/)
|
|
assert.match(source, /status === 'RELEASED'/)
|
|
})
|
|
|
|
test('truck matrix remains independent while retaining its own lifecycle', () => {
|
|
for (const status of ['DRAFT', 'PENDING_DISPATCH', 'DISPATCHED', 'PICKUP_IN_PROGRESS',
|
|
'ARRIVED_WAREHOUSE', 'LOADING', 'DEPARTED', 'COMPLETED', 'RESCHEDULED', 'EXCEPTION', 'CANCELLED']) {
|
|
assert.match(source, new RegExp(`['\"]${status}['\"]`))
|
|
}
|
|
assert.match(source, /page=1&size=100&status=/)
|
|
})
|