test: align phase five dev acceptance flows

This commit is contained in:
2026-09-02 03:32:35 +08:00
parent f3be06a3e0
commit a4a4306154
13 changed files with 106 additions and 103 deletions
@@ -87,6 +87,7 @@ export async function run(context) {
const expectedBatchOperationIds = Array.isArray(fixture?.expectedBatchOperationIds)
? fixture.expectedBatchOperationIds.map(id).filter(Boolean) : []
const actualBatchOperationIds = batchOperations.map((item) => id(item.operationId)).filter(Boolean)
const expectedBatchCount = fixture?.fulfillmentType === 'ONE_CLICK_DROPSHIP' ? 1 : 4
context.assert(MODULE, '最终完成前保留领取操作且不伪造复核或完成历史', operationsResponse,
Array.isArray(operations) && operations.some((item) => item.actionType === 'CLAIM'
&& Boolean(item.operatorId) && Boolean(item.createdAt))
@@ -95,10 +96,10 @@ export async function run(context) {
`actions=${Array.isArray(operations) ? operations.map((item) => item.actionType).join(',') : 'missing'}`, OPTIONS)
context.assert(MODULE, 'PDA 原子批次完成审计包含 BATCH 操作', operationsResponse,
expectedBatchOperationIds.length === 4
&& new Set(expectedBatchOperationIds).size === 4
&& actualBatchOperationIds.length === 4
&& new Set(actualBatchOperationIds).size === 4
expectedBatchOperationIds.length === expectedBatchCount
&& new Set(expectedBatchOperationIds).size === expectedBatchCount
&& actualBatchOperationIds.length === expectedBatchCount
&& new Set(actualBatchOperationIds).size === expectedBatchCount
&& expectedBatchOperationIds.every((operationId) => actualBatchOperationIds.includes(operationId))
&& actualBatchOperationIds.every((operationId) => expectedBatchOperationIds.includes(operationId)),
`expectedBatchCount=${expectedBatchOperationIds.length}, actualBatchCount=${actualBatchOperationIds.length}, expectedIds=${expectedBatchOperationIds.join(',') || 'missing'}, actualIds=${actualBatchOperationIds.join(',') || 'missing'}`, OPTIONS)