完成单机TEST统一入口与可靠投递回归收尾
This commit is contained in:
@@ -41,17 +41,9 @@ function fixture(options = {}) {
|
||||
marker, calls, steps, gaps, blockers,
|
||||
context: { merchantQualificationFixture: credentials },
|
||||
createdResources: { merchantQualificationFixture: { tenantId: '10001', marker } },
|
||||
async request(method, requestPath, body) {
|
||||
calls.push({ channel: 'domestic', method, path: requestPath, body })
|
||||
if (requestPath.includes('/iam/tenants?')) return response(page(activeCustomers))
|
||||
if (requestPath === '/api/auth/login') return response({ overseasAccessToken: 'merchant-overseas-token' })
|
||||
if (method === 'POST' && requestPath === '/api/platform/v1/warehouse-admin') return response('20001')
|
||||
if (method === 'PATCH' && requestPath.includes('/warehouse-admin/20001/status?')) {
|
||||
state.warehouseStatus = 'INACTIVE'; return response(null)
|
||||
}
|
||||
throw new Error(`unexpected domestic ${method} ${requestPath}`)
|
||||
},
|
||||
async requestOverseas(method, requestPath, body, headers, token) {
|
||||
async request(...args) {
|
||||
const route = /\/(?:last-leg|overseas-warehouse-resources)(?:\/|\?|$)/.test(String(args[1]));
|
||||
const handler = route ? async function(method,requestPath,body,token,headers) {
|
||||
calls.push({ channel: 'overseas', method, path: requestPath, body, tokenPresent: Boolean(token) })
|
||||
|
||||
if (requestPath === '/api/merchant/v1/last-leg/overseas-procurements' && method === 'POST') {
|
||||
@@ -185,7 +177,19 @@ function fixture(options = {}) {
|
||||
return response(looseboardDetail())
|
||||
}
|
||||
throw new Error(`unexpected ${method} ${requestPath}`)
|
||||
},
|
||||
} : async function(method,requestPath,body) {
|
||||
calls.push({ channel: 'domestic', method, path: requestPath, body })
|
||||
if (requestPath.includes('/iam/tenants?')) return response(page(activeCustomers))
|
||||
if (requestPath === '/api/auth/login') return response({ accessToken: 'merchant-overseas-token' })
|
||||
if (method === 'POST' && requestPath === '/api/platform/v1/warehouse-admin') return response('20001')
|
||||
if (method === 'PATCH' && requestPath.includes('/warehouse-admin/20001/status?')) {
|
||||
state.warehouseStatus = 'INACTIVE'; return response(null)
|
||||
}
|
||||
throw new Error(`unexpected domestic ${method} ${requestPath}`)
|
||||
};
|
||||
return handler.apply(this,args);
|
||||
},
|
||||
|
||||
apiSuccess(module, name, result, evidence, stepOptions) {
|
||||
const passed = result.http === 200 && String(result.body?.code) === '200'
|
||||
this.addStep(module, name, result, passed, evidence, stepOptions)
|
||||
@@ -215,7 +219,7 @@ test('module is context injected, blocks missing prerequisites and excludes forb
|
||||
for (const forbidden of ['/outbounds', '/receive-pallets', '/outbound', '/delivery', '/dispatch', '/export']) {
|
||||
assert.equal(source.includes(forbidden), false, forbidden)
|
||||
}
|
||||
assert.doesNotMatch(source, /requestOverseas\('DELETE'/)
|
||||
assert.doesNotMatch(source, /request\('DELETE'/)
|
||||
})
|
||||
|
||||
test('complete procurement truck and looseboard lifecycles pass with legal marker terminals', async () => {
|
||||
|
||||
Reference in New Issue
Block a user