test(firstleg): cover simulated container booking links

This commit is contained in:
2026-08-14 21:00:20 +08:00
parent 7184f5083a
commit a4a4374c67
14 changed files with 318 additions and 81 deletions
@@ -4,14 +4,14 @@ import test from 'node:test'
const source = readFileSync(new URL('./phase3-order-splitting.mjs', import.meta.url), 'utf8')
test('each remainder follows confirmed booking before scoped smart-loading candidates', () => {
test('each remainder uses a simulation explicitly linked to a confirmed booking', () => {
assert.match(source, /POST', CONTAINERS/)
assert.match(source, /POST', '\/api\/platform\/v1\/ocean-bookings'/)
assert.match(source, /ocean-bookings\/\$\{oceanBookingId\}\/submit/)
assert.match(source, /ocean-bookings\/\$\{oceanBookingId\}\/confirm/)
assert.match(source, /containerAllocations\?\.\[0\]\?\.containerBookingId/)
assert.match(source, /ocean-booking-link/)
assert.match(source, /candidates\?bookingId=\$\{encodeURIComponent\(containerId\)\}&warehouseId=\$\{encodeURIComponent\(warehouseId\)\}/)
assert.match(source, /`\$\{SMART\}\/plans`, \{ bookingId: containerId/)
assert.doesNotMatch(source, /request\(context, 'POST', CONTAINERS/)
assert.doesNotMatch(source, /candidates\?warehouseId=/)
})