This commit is contained in:
2026-08-28 13:58:49 +08:00
parent 6b5f2f0565
commit bb9673358d
3 changed files with 36 additions and 7 deletions
@@ -44,9 +44,13 @@ test('semantic contract creates one independent plan per order even for the same
test('server container summary remains complete when the order page would contain only ten rows', () => {
assert.equal(CONTAINER_SUMMARY_ENDPOINT, '/api/platform/v1/last-leg/orders/container-summaries')
assert.equal(validContainerSummaryPage({
records: [{ sourceContainerBookingId: 'CB-1', containerNo: 'C1', orderCount: '15', inboundCodeCount: '15' }],
records: [{ sourceContainerBookingId: 'CB-1', containerNo: 'C1', totalOrderCount: '15', inboundCodeCount: '15',
missingInboundCodeCount: 0, planCount: 0, plannedInboundCodeCount: 0, pendingPlanCount: 15,
allPlansReady: false }],
page: '1', size: '10', total: '1', pages: '1',
}, { sourceContainerBookingId: 'CB-1', containerNo: 'C1', orderCount: 15, inboundCodeCount: 15 }), true)
}, { sourceContainerBookingId: 'CB-1', containerNo: 'C1', totalOrderCount: 15, inboundCodeCount: 15,
missingInboundCodeCount: 0, planCount: 0, plannedInboundCodeCount: 0, pendingPlanCount: 15,
allPlansReady: false }), true)
})
test('atomic failure and replay helpers reject drift', () => {
@@ -75,7 +79,7 @@ test('container API uses one stable long string identity', () => {
assert.match(endpoint, /sourceContainerBookingId:\s*\{ type: string/)
assert.match(controller, /convertContainer/)
assert.match(adminApi, /sourceContainerBookingId: string/)
assert.match(adminView, /sourceContainerBookingId: row\.sourceContainerBookingId/)
assert.match(adminView, /sourceContainerBookingId: container\.sourceContainerBookingId/)
})
test('backend batch conversion is one transaction and never merges same-customer orders', () => {
@@ -89,9 +93,9 @@ test('backend batch conversion is one transaction and never merges same-customer
})
test('Admin consumes a server-paged container summary and never derives 15 from the current order page', () => {
assert.match(adminApi, /(?:listLastMileContainerSummaries|listContainerSummaries)/)
assert.match(adminApi, /listContainerPlanProgress/)
assert.match(adminApi, /container-summaries/)
assert.match(adminView, /(?:listLastMileContainerSummaries|listContainerSummaries)\(/)
assert.match(adminView, /listContainerPlanProgress\(/)
assert.match(adminView, /containerRows\.value\s*=\s*result\.records/)
assert.doesNotMatch(adminView, /(?:rows|result\.records)\.value?\.(?:reduce|filter|forEach)[\s\S]{0,300}containerNo/)
})