diff --git a/scripts/admin-test-env-modules/phase3-container-overview.mjs b/scripts/admin-test-env-modules/phase3-container-overview.mjs index 04df5e4c0..3c05d8e29 100644 --- a/scripts/admin-test-env-modules/phase3-container-overview.mjs +++ b/scripts/admin-test-env-modules/phase3-container-overview.mjs @@ -69,7 +69,7 @@ export async function run(context) { `taskStatus=${overview.pda.taskStatus || 'missing'}, workflowStatus=${overview.pda.workflowStatus || 'missing'}, completed=${overview.pda.completedItemCount ?? 'missing'}/${overview.pda.itemCount ?? 'missing'}`, OPTIONS) for (const [index, photo] of overview.pda.photos.entries()) { context.assert(MODULE, `overview PDA 照片摘要 ${index + 1} 字段完整`, overviewResponse, - ['evidenceId', 'fileId', 'status', 'downloadPath'].every((field) => photo[field] !== undefined), + ['evidenceId', 'fileId', 'status'].every((field) => photo[field] !== undefined), `fileId=${id(photo.fileId)}`, OPTIONS) const downloadPath = String(photo.downloadPath || '') if (photo.status === 'VOID') { diff --git a/scripts/admin-test-env-modules/phase3-container-regression-contract.test.mjs b/scripts/admin-test-env-modules/phase3-container-regression-contract.test.mjs index 74a5e1e3c..b05d3c69d 100644 --- a/scripts/admin-test-env-modules/phase3-container-regression-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase3-container-regression-contract.test.mjs @@ -41,12 +41,16 @@ test('overview regression requires workflowStatus and distinguishes 100 percent test('active overview photos download through controlled paths while void history has no download entry', () => { assert.match(overviewOpenApi, /\/api\/platform\/v1\/containers\/\{id\}\/pda\/photos\/\{fileId\}\/download/) + assert.match(overviewAcceptance, /\['evidenceId', 'fileId', 'status'\]\.every/) + assert.doesNotMatch(overviewAcceptance, /\['evidenceId', 'fileId', 'status', 'downloadPath'\]\.every/) assert.match(overviewAcceptance, /context\.requestBinary\('GET', downloadPath\)/) assert.match(overviewAcceptance, /photo\.status === 'VOID'/) assert.match(overviewAcceptance, /overview PDA 作废照片 \$\{index \+ 1\} 无下载入口/) assert.match(overviewAcceptance, /photo\.status !== 'ACTIVE' \|\| !controlledPath/) assert.match(overviewOpenApi, /status: \{type: string, enum: \[ACTIVE, VOID\]\}/) assert.match(overviewOpenApi, /downloadPath: \{type: string, nullable: true, description: '仅 ACTIVE 照片提供鉴权下载路径;VOID 历史照片为空'\}/) + assert.equal(overviewAcceptance.indexOf("if (photo.status === 'VOID')") + < overviewAcceptance.indexOf("context.requestBinary('GET', downloadPath)"), true) assert.equal(controlledPhotoDownload('/api/platform/v1/containers/7/pda/photos/23/download', { http: 200, bytes: new Uint8Array([1]), contentType: 'image/png', }), true)