优化
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { plan, config, assertCustomer, allowedRequest, client, listAll, preflight, main } from './prod-release-acceptance.mjs'
|
||||
import { plan, config, assertCustomer, allowedRequest, client, listAll, preflight, main, DOMESTIC_WAREHOUSE_CODES } from './prod-release-acceptance.mjs'
|
||||
|
||||
function environment() {
|
||||
const env = { CHONGCHONG_ENV: 'prod',
|
||||
@@ -22,6 +22,7 @@ test('single order scope does not claim implemented or full coverage', () => {
|
||||
const result = plan()
|
||||
assert.equal(result.scope.orders, 1)
|
||||
assert.equal(result.scope.sameOrder, true)
|
||||
assert.deepEqual(result.scope.origins, [...DOMESTIC_WAREHOUSE_CODES])
|
||||
assert.equal(result.scope.receiving, 'US-LAX-01')
|
||||
assert.equal(result.fullFlowVerified, false)
|
||||
assert.equal(result.stages.filter(s => s.status === 'IMPLEMENTED_NOT_HTTP_VERIFIED').length, 2)
|
||||
@@ -87,10 +88,12 @@ function fakeHttp(bindingId = '3') {
|
||||
if (method === 'POST') return { accessToken: 'fixture-token', overseasAccessToken: 'fixture-overseas-token' }
|
||||
if (path.includes('/iam/')) return profile
|
||||
if (path.includes('/warehouse-profile')) return { warehouseId: bindingId, warehouseCode: 'US-LAX-01' }
|
||||
if (path.endsWith('/pda-loading/warehouses')) return [{ id: '2', warehouseCode: 'CN-YIWU-01' }]
|
||||
if (path.endsWith('/pda-loading/warehouses')) return [{ id: '2', warehouseCode: 'CN-YIWU-01' }, { id: '4', warehouseCode: 'CN-DONGGUAN-01' }]
|
||||
if (path.includes('/warehouse-admin?')) {
|
||||
const domestic = path.includes('warehouseType=DOMESTIC')
|
||||
return { total: '1', records: [{ id: domestic ? '2' : '3', warehouseCode: domestic ? 'CN-YIWU-01' : 'US-LAX-01', status: 'ACTIVE' }] }
|
||||
return domestic
|
||||
? { total: '2', records: [{ id: '2', warehouseCode: 'CN-YIWU-01', status: 'ACTIVE' }, { id: '4', warehouseCode: 'CN-DONGGUAN-01', status: 'ACTIVE' }] }
|
||||
: { total: '1', records: [{ id: '3', warehouseCode: 'US-LAX-01', status: 'ACTIVE' }] }
|
||||
}
|
||||
return { total: '1', records: [{ warehouseId: '2', status: 'AVAILABLE' }] }
|
||||
} }
|
||||
|
||||
Reference in New Issue
Block a user