test(firstleg): finish task evidence migration
This commit is contained in:
@@ -107,7 +107,7 @@ export async function run(context) {
|
||||
context.apiSuccess(MODULE, '查询出口报关资料', customs, `loadingPlanId=${planId}, warehouseId=${warehouseId}`, OPTIONS)
|
||||
} else {
|
||||
context.assert(MODULE, '运行中计划尚未生成完成装柜清单,出口报关资料拒绝读取', customs,
|
||||
customs.http === 200 && String(customs.body?.code) === 'A0409',
|
||||
customs.http === 200 && String(customs.body?.code) === 'A0404',
|
||||
`loadingPlanId=${planId}, status=${fixture?.finalStatus || 'missing'}`, OPTIONS)
|
||||
}
|
||||
|
||||
|
||||
@@ -1068,7 +1068,7 @@ export async function run(context) {
|
||||
const wrongWarehouseEvidence = await context.request('GET',
|
||||
`${evidencePath}?warehouseId=${encodeURIComponent(Number(warehouseId) + 1)}`)
|
||||
context.addStep(MODULE, '错误仓库作用域不可读取本轮 task 装柜证据', wrongWarehouseEvidence,
|
||||
wrongWarehouseEvidence.http === 403 && codeOf(wrongWarehouseEvidence) === 'A0403',
|
||||
wrongWarehouseEvidence.http === 200 && codeOf(wrongWarehouseEvidence) === 'A0403',
|
||||
`HTTP=${wrongWarehouseEvidence.http}, code=${codeOf(wrongWarehouseEvidence)}`, OPTIONS)
|
||||
const wrongTaskEvidence = await context.request('GET',
|
||||
`${pdaBase}/tasks/999999999999999999/evidence?warehouseId=${encodeURIComponent(warehouseId)}`)
|
||||
|
||||
@@ -71,10 +71,12 @@ export async function run(context) {
|
||||
&& pendingActions.length === 0,
|
||||
`workflow=${taskDetail?.workflowStatus || 'missing'}, unresolved=${unresolvedItems.length}, actions=${pendingActions.length}`, OPTIONS)
|
||||
const evidenceResponse = await request(context, 'GET',
|
||||
`/api/platform/v1/inbounds/${inboundId}/loading/evidence?tenantId=${encodeURIComponent(tenantId)}`)
|
||||
`${taskPath}/evidence?warehouseId=${encodeURIComponent(warehouseId)}`)
|
||||
const evidence = context.apiSuccess(MODULE, 'AWAITING_REVIEW 可进入装柜取证只读入口', evidenceResponse, '', OPTIONS)
|
||||
context.assert(MODULE, 'AWAITING_REVIEW 取证 GET 开放且不依赖重复 batch', evidenceResponse,
|
||||
taskDetail?.workflowStatus === 'AWAITING_REVIEW' && Array.isArray(evidence?.evidences),
|
||||
taskDetail?.workflowStatus === 'AWAITING_REVIEW' && id(evidence?.taskId) === taskId
|
||||
&& id(evidence?.containerBookingId) === id(fixture?.containerBookingId)
|
||||
&& Array.isArray(evidence?.evidences),
|
||||
`workflow=${taskDetail?.workflowStatus || 'missing'}, evidences=${evidence?.evidences?.length ?? 'missing'}, actions=${pendingActions.length}`, OPTIONS)
|
||||
const operationsResponse = await request(context, 'GET',
|
||||
`${taskPath}/operations`)
|
||||
|
||||
@@ -24,6 +24,8 @@ test('AWAITING_REVIEW derives zero client actions and never needs a repeated bat
|
||||
assert.match(convergence, /pending 与 detail 使用同一 workflowStatus 和未完成数量事实/)
|
||||
assert.match(convergence, /AWAITING_REVIEW 已全拣任务 actions 为空且不再提交 batch/)
|
||||
assert.match(convergence, /AWAITING_REVIEW 可进入装柜取证只读入口/)
|
||||
assert.match(convergence, /\$\{taskPath\}\/evidence\?warehouseId=\$\{encodeURIComponent\(warehouseId\)\}/)
|
||||
assert.doesNotMatch(convergence, /api\/platform\/v1\/inbounds\/\$\{inboundId\}\/loading\/evidence/)
|
||||
assert.match(convergence, /filter\(\(item\) => item\.actionType === 'BATCH'/)
|
||||
assert.match(convergence, /expectedBatchOperationIds\.length === 4/)
|
||||
assert.match(convergence, /actualBatchOperationIds\.length === 4/)
|
||||
|
||||
Reference in New Issue
Block a user