test(fba): preserve verified fleet and fulfillment acceptance workflows
This commit is contained in:
@@ -3,8 +3,7 @@ import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
import { transition } from './order-inbound-status-fixtures.mjs'
|
||||
import { createCompletedOrder, transition } from './order-inbound-status-fixtures.mjs'
|
||||
|
||||
test('dynamic Platform cancellation freezes version and key while reject body stays unchanged',async()=>{
|
||||
const calls=[]
|
||||
@@ -21,6 +20,26 @@ test('dynamic Platform cancellation freezes version and key while reject body st
|
||||
const here = path.dirname(fileURLToPath(import.meta.url))
|
||||
const source = fs.readFileSync(path.join(here, 'order-inbound-status-fixtures.mjs'), 'utf8')
|
||||
|
||||
test('完成样本来自真实履约编排且缺证据或客户漂移均阻断', async () => {
|
||||
const context = { context: { phase4ReceivingEvidenceReader() {} }, createdResources: { orders: { orderId: '11' } } }
|
||||
const prepare = async scope => { scope.context.merchantQualificationFixture = { tenantId: '7' } }
|
||||
const run = proof => async scope => {
|
||||
assert.equal(scope.context.f40SignatureOrder, 'ROOT_FIRST')
|
||||
assert.equal(scope.context.phase4ReceivingEvidenceReader, context.context.phase4ReceivingEvidenceReader)
|
||||
scope.createdResources.phase5RootFulfillment = proof
|
||||
}
|
||||
assert.deepEqual(await createCompletedOrder(context, run({ finalStatus: 'VERIFIED', customerId: '7', rootOrderId: '99' }), prepare),
|
||||
{ orderId: '99', tenantId: '7' })
|
||||
assert.equal(context.createdResources.orders.orderId, '11')
|
||||
assert.equal(context.createdResources.phase5RootFulfillment, undefined)
|
||||
for (const proof of [{ finalStatus: 'HTTP_VERIFIED_OUTBOX_PENDING', customerId: '7', rootOrderId: '99' },
|
||||
{ finalStatus: 'VERIFIED', customerId: '8', rootOrderId: '99' }]) {
|
||||
await assert.rejects(createCompletedOrder(context, run(proof), prepare), /真实签收/)
|
||||
}
|
||||
assert.doesNotMatch(source, /'start', 'complete'/)
|
||||
assert.match(source, /phase5-root-fulfillment\.mjs/)
|
||||
})
|
||||
|
||||
test('为头程订单列表八个真实状态分别创建独立样本', () => {
|
||||
for (const status of ['DRAFT', 'SUBMITTED', 'REJECTED', 'APPROVED', 'ACCEPTED', 'PROCESSING', 'COMPLETED', 'CANCELLED']) {
|
||||
assert.match(source, new RegExp(`\\['${status}', \\[`))
|
||||
|
||||
Reference in New Issue
Block a user