This commit is contained in:
2026-08-26 11:10:42 +08:00
parent 15421db421
commit cf5d603a21
35 changed files with 664 additions and 435 deletions
@@ -4,6 +4,7 @@ import test from 'node:test'
const acceptance = readFileSync(new URL('../admin-test-env-acceptance.mjs', import.meta.url), 'utf8')
const fixture = readFileSync(new URL('./merchant-qualification-fixture.mjs', import.meta.url), 'utf8')
const orders = readFileSync(new URL('./orders.mjs', import.meta.url), 'utf8')
test('默认全量验收先准备已审核商户再运行订单链路', () => {
const modules = acceptance.match(/const CONFIGURED_MODULES = \[([^\n]+)\]/)?.[1] || ''
@@ -22,5 +23,38 @@ test('商户夹具通过正式 File 和 IAM 审核流程建立下单资格', ()
assert.match(fixture, /item\.status === 'APPROVED'/)
assert.match(fixture, /MERCHANT_TEST_USERNAME/)
assert.match(fixture, /MERCHANT_TEST_PASSWORD/)
assert.match(fixture, /context\.options\?\.customerName/)
assert.doesNotMatch(fixture, /internal\/iam|UPDATE\s+iam_|INSERT\s+INTO\s+iam_/i)
})
test('批量待分柜参数固定同一客户并限制为订单测量链', () => {
assert.match(acceptance, /--customer-name <name>/)
assert.match(acceptance, /--merchant-username <name>/)
assert.match(acceptance, /--origin-warehouse-name <name>/)
assert.match(acceptance, /--channel-name <name>/)
assert.match(acceptance, /--wait-split-count <n>/)
assert.match(acceptance, /--order-profile-mode <mode>/)
assert.match(acceptance, /merchant-username和merchant-password必须同时提供/)
assert.match(acceptance, /modules\.splice\(fixtureIndex, 1\)/)
assert.match(acceptance, /wait-split-count必须是1-100的整数/)
assert.match(acceptance, /批量WAIT_SPLIT只允许执行merchant-qualification-fixture、orders、inbound-measurement/)
assert.match(acceptance, /createAdditionalWaitSplitFixtures/)
assert.match(acceptance, /measurement\.processStatus === 'WAIT_SPLIT'/)
assert.match(acceptance, /measurement\.finalStatus === 'APPROVED'/)
assert.match(acceptance, /waitSplitVariant\(sequence\)/)
assert.match(acceptance, /packageCountPerSku/)
assert.match(acceptance, /grossWeightPerPalletKg/)
assert.match(acceptance, /randomizedOrderProfile\(sequence\)/)
assert.match(acceptance, /\['PRIVATE', 'STANDARD'\]/)
assert.match(acceptance, /ONE_CLICK_DROPSHIP/)
assert.match(acceptance, /destinationWarehouseCode: order\.destinationWarehouseCode/)
assert.match(acceptance, /channelName: order\.channelName/)
assert.match(acceptance, /pricingTaxMode: order\.pricingTaxMode/)
assert.match(orders, /customerId: profile\.id/)
assert.match(orders, /customerName: companyName/)
assert.match(orders, /\['FBA', 'OVERSEAS', 'PRIVATE'\]\.includes/)
assert.match(orders, /destinationType === 'PRIVATE'/)
assert.match(orders, /PRIVATE_ADDRESS/)
assert.match(orders, /eligible\.length < 1/)
assert.doesNotMatch(orders, /customerName: master\.partner\?\.partnerName/)
})