fix(scripts): read domestic container list payload
This commit is contained in:
@@ -10,6 +10,8 @@ test('domestic container fixtures use the current workbench detail route', () =>
|
||||
assert.ok(!containerLoading.includes("context.request('GET', `${CONTAINERS}/${containerId}`)"))
|
||||
assert.ok(containerLoading.includes('const containerDetail = containerWorkbench?.container'))
|
||||
assert.ok(containerLoading.includes('const simulationBeforeLink = simulationWorkbench?.container'))
|
||||
assert.ok(containerLoading.includes('`${CONTAINERS}/domestic?page=1&size=50&keyword='))
|
||||
assert.ok(containerLoading.includes('records(activeWorkbench).map((item) => item?.container)'))
|
||||
|
||||
const loading = read('./phase3-loading.mjs')
|
||||
assert.ok(loading.includes("context.request('GET', `/api/platform/v1/containers/domestic/${containerBookingId}`)"))
|
||||
@@ -20,6 +22,8 @@ test('domestic container fixtures use the current workbench detail route', () =>
|
||||
const fixtureId = 'encodeURIComponent(id(phase3.containerBookingId))'
|
||||
assert.ok(crossRegion.includes(`/api/platform/v1/containers/domestic/\${${fixtureId}}`))
|
||||
assert.ok(!crossRegion.includes(`/api/platform/v1/containers/\${${fixtureId}}`))
|
||||
assert.ok(crossRegion.includes('/api/platform/v1/containers/domestic?containerNo='))
|
||||
assert.ok(crossRegion.includes('.map((item) => item?.container).filter('))
|
||||
})
|
||||
|
||||
test('service center truck fixture uses the released booking warehouse', () => {
|
||||
|
||||
@@ -473,8 +473,10 @@ export async function run(context) {
|
||||
`containerBookingId=${containerId}, cabinetNo=${linkedContainer?.cabinetNo || 'missing'}, loadingPlanId=${id(afterLinkPlan?.id) || 'missing'}`, OPTIONS)
|
||||
|
||||
const activeContainersResponse = await context.request('GET',
|
||||
`${CONTAINERS}?page=1&size=50&keyword=${encodeURIComponent(realContainerNo)}`)
|
||||
const activeContainers = context.apiSuccess(MODULE, '关联后按真实柜号回查正常货柜列表', activeContainersResponse, '', OPTIONS)
|
||||
`${CONTAINERS}/domestic?page=1&size=50&keyword=${encodeURIComponent(realContainerNo)}`)
|
||||
const activeWorkbench = context.apiSuccess(MODULE, '关联后按真实柜号回查正常货柜列表', activeContainersResponse, '', OPTIONS)
|
||||
const activeContainers = { ...activeWorkbench,
|
||||
records: records(activeWorkbench).map((item) => item?.container).filter(Boolean) }
|
||||
const activeRealRows = records(activeContainers).filter((item) => item.containerNo === realContainerNo)
|
||||
context.assert(MODULE, '关联后列表仅保留模拟柜原地补全的一条 ACTIVE 操作身份', activeContainersResponse,
|
||||
activeRealRows.length === 1 && id(activeRealRows[0]?.id) === containerId,
|
||||
|
||||
@@ -50,7 +50,7 @@ function context(resources = {}) {
|
||||
unloadingPhotoUploadedAt: '2026-08-24T09:00:00Z', estimatedEmptyReportedAt: '2026-08-26T09:00:00Z',
|
||||
actualEmptyReportedAt: null, emptyReportSourceVersion: 7,
|
||||
} })
|
||||
return response(path, { records: [{ id: '3001', containerNo: 'MSCU1234567' }] })
|
||||
return response(path, { records: [{ container: { id: '3001', containerNo: 'MSCU1234567' } }] })
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,10 +99,10 @@ export async function run(context) {
|
||||
'missing-overseas-container-identity', orderDetail)
|
||||
}
|
||||
|
||||
const containerPagePath = `/api/platform/v1/containers?containerNo=${encodeURIComponent(completedContainerNo)}&page=1&size=20`
|
||||
const containerPagePath = `/api/platform/v1/containers/domestic?containerNo=${encodeURIComponent(completedContainerNo)}&page=1&size=20`
|
||||
const containerPage = await context.request('GET', containerPagePath)
|
||||
const domesticMatches = records(containerPage.body?.data)
|
||||
.filter((item) => item?.containerNo === completedContainerNo)
|
||||
.map((item) => item?.container).filter((item) => item?.containerNo === completedContainerNo)
|
||||
context.assert(MODULE, '物理柜号唯一定位国内柜聚合', containerPage,
|
||||
success(containerPage) && domesticMatches.length === 1 && traced(containerPage),
|
||||
evidence(containerPage, `containerNo=${completedContainerNo}, matches=${domesticMatches.length}`), OPTIONS)
|
||||
|
||||
Reference in New Issue
Block a user