From a10e32a012366fdb2b21746e67d208951e206c07 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Tue, 1 Sep 2026 14:48:51 +0800 Subject: [PATCH] test(firstleg): finish task evidence migration --- .../admin-test-env-modules/phase3-container-overview.mjs | 2 +- scripts/admin-test-env-modules/phase3-loading.mjs | 2 +- scripts/admin-test-env-modules/phase3-pda-convergence.mjs | 6 ++++-- .../phase3-pda-pending-consistency-contract.test.mjs | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/admin-test-env-modules/phase3-container-overview.mjs b/scripts/admin-test-env-modules/phase3-container-overview.mjs index 8da3091d7..43f9bca8e 100644 --- a/scripts/admin-test-env-modules/phase3-container-overview.mjs +++ b/scripts/admin-test-env-modules/phase3-container-overview.mjs @@ -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) } diff --git a/scripts/admin-test-env-modules/phase3-loading.mjs b/scripts/admin-test-env-modules/phase3-loading.mjs index 4db161c7f..ed57a829b 100644 --- a/scripts/admin-test-env-modules/phase3-loading.mjs +++ b/scripts/admin-test-env-modules/phase3-loading.mjs @@ -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)}`) diff --git a/scripts/admin-test-env-modules/phase3-pda-convergence.mjs b/scripts/admin-test-env-modules/phase3-pda-convergence.mjs index f76ab00e3..937804c87 100644 --- a/scripts/admin-test-env-modules/phase3-pda-convergence.mjs +++ b/scripts/admin-test-env-modules/phase3-pda-convergence.mjs @@ -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`) diff --git a/scripts/admin-test-env-modules/phase3-pda-pending-consistency-contract.test.mjs b/scripts/admin-test-env-modules/phase3-pda-pending-consistency-contract.test.mjs index caaea1192..060cb8158 100644 --- a/scripts/admin-test-env-modules/phase3-pda-pending-consistency-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase3-pda-pending-consistency-contract.test.mjs @@ -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/)