This commit is contained in:
2026-09-04 11:35:19 +08:00
parent c3729249c4
commit f23f3ea26d
21 changed files with 476 additions and 97 deletions
@@ -6,18 +6,28 @@ const source = await readFile(new URL('./client-quick-order-test-env-acceptance.
test('quick-order HTTP acceptance uses the same endpoint and skeletal cargo payload as Client', () => {
assert.match(source, /\/api\/merchant\/v1\/orders\/first-leg\/batch/)
assert.match(source, /cargoName: '', packageType: 'CARTON', packageCount: 2, grossWeightKg: 0, volumeCbm: 0/)
assert.match(source, /cargoes: Array\.from\(\{ length: cargoCount \}/)
assert.match(source, /cargoName: '', packageType: 'CARTON', packageCount: index \+ 1, grossWeightKg: 0, volumeCbm: 0/)
assert.match(source, /destinationType: 'FBA'/)
assert.match(source, /destinationType: 'OVERSEAS'/)
assert.match(source, /destinationType: 'PRIVATE'/)
assert.match(source, /addresses\?addressType=PRIVATE_DESTINATION/)
assert.match(source, /privateDestinationAddressId: String\(privateAddress\.id\)/)
assert.match(source, /privateDestinationAddressId: String\(address\.id\)/)
})
test('quick-order HTTP acceptance verifies partial failure, detail ownership, and idempotent replay', () => {
assert.match(source, /expected succeeded=3/)
assert.match(source, /invalid channel row must fail independently/)
test('quick-order HTTP acceptance verifies expanded row, cargo, isolation, retry, and idempotency behavior', () => {
assert.match(source, /expected succeeded=5/)
assert.match(source, /cargo count mismatch/)
assert.match(source, /unowned private address must fail closed with A0404/)
assert.match(source, /duplicate clientRowId must fail independently with A0409/)
assert.match(source, /draft must belong to the authenticated enterprise/)
assert.match(source, /same idempotency key replays the same quick-order drafts/)
assert.match(source, /idempotent replay returned different order IDs/)
assert.match(source, /same row id and idempotency key reject a changed payload/)
assert.match(source, /a corrected failed row succeeds under a fresh batch key/)
assert.match(source, /--random-count <1-50>/)
assert.match(source, /create \$\{randomCount\} randomized quick-order drafts/)
assert.match(source, /verify all \$\{randomCount\} randomized drafts/)
assert.match(source, /replay all \$\{randomCount\} randomized drafts idempotently/)
assert.match(source, /randomInt\(1, 6\)/)
})