test(firstleg): parse platform warehouse scope explicitly
This commit is contained in:
@@ -2,7 +2,16 @@ import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
import { inspectOceanBookingIdentity, truckAppointmentPayload } from './truck-appointments.mjs'
|
||||
import { inspectOceanBookingIdentity, platformWarehouseIdentity, truckAppointmentPayload } from './truck-appointments.mjs'
|
||||
|
||||
test('platform warehouse scope is fixed to zero without requiring response tenantId', () => {
|
||||
assert.deepEqual(platformWarehouseIdentity({ warehouseId: '41', warehouseName: '宁波仓' }),
|
||||
{ warehouseId: '41', platformTenantId: '0' })
|
||||
assert.deepEqual(platformWarehouseIdentity({ id: 42, warehouseName: '义乌仓' }),
|
||||
{ warehouseId: '42', platformTenantId: '0' })
|
||||
const source = readFileSync(new URL('truck-appointments.mjs', import.meta.url), 'utf8')
|
||||
assert.doesNotMatch(source, /item\?\.tenantId|item\.tenantId/)
|
||||
})
|
||||
|
||||
test('booking identity is marker scoped and contains no customer snapshot', () => {
|
||||
const result = inspectOceanBookingIdentity('RUN-2', { id: '91', marker: 'RUN-2', warehouseId: '41' })
|
||||
|
||||
Reference in New Issue
Block a user