test: align ocean booking fixtures with direct confirmed flow

This commit is contained in:
2026-08-15 09:35:52 +08:00
parent e4d5e6d631
commit 1982a7dd69
15 changed files with 118 additions and 149 deletions
@@ -7,8 +7,11 @@ const source = readFileSync(new URL('./phase3-order-splitting.mjs', import.meta.
test('each remainder uses a simulation linked to a confirmed then released 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, /一次登记直接返回 CONFIRMED/)
assert.doesNotMatch(source, /ocean-bookings\/\$\{oceanBookingId\}\/(?:submit|confirm)/)
const createPayload = source.slice(source.indexOf('function bookingPayload'), source.indexOf('async function loadOneFragment'))
for (const field of ['billOfLadingNo', 'vesselName', 'voyageNo', 'estimatedSailingAt',
'estimatedArrivalAt']) assert.match(createPayload, new RegExp(`${field}:`))
assert.match(source, /ocean-booking-link/)
assert.match(source, /bookingDetail\.oceanBooking\.status === 'CONFIRMED'/)
assert.match(source, /`\$\{bookingPath\}\/release`/)