Merge branch 'release/test' of http://8.163.30.128:10082/html/pda-overseas-uniapp into release/test
This commit is contained in:
@@ -274,6 +274,21 @@ test('authenticated photo download maps the public api path through the H5 overs
|
||||
assert.equal(calls[0].header.Authorization, `Bearer ${value.overseasAccessToken}`)
|
||||
})
|
||||
|
||||
test('image download rejects a JSON error envelope returned with HTTP 200', async () => {
|
||||
prepareSession()
|
||||
globalThis.uni.downloadFile = (options) => options.success({
|
||||
statusCode: 200,
|
||||
tempFilePath: '/tmp/error.json',
|
||||
header: { 'Content-Type': 'application/json', 'X-Request-Id': 'photo-request', 'X-Trace-Id': 'photo-trace' }
|
||||
})
|
||||
|
||||
await assert.rejects(
|
||||
overseasDownload('/api/pda/v1/last-leg/photo', { expectedContentTypePrefix: 'image/' }),
|
||||
(error) => error.message === '照片服务返回了无效内容,请稍后重试'
|
||||
&& error.requestId === 'photo-request' && error.traceId === 'photo-trace'
|
||||
)
|
||||
})
|
||||
|
||||
test('business and network errors retain diagnostics without refreshing or clearing a valid session', async () => {
|
||||
prepareSession(); let refreshCount = 0
|
||||
globalThis.uni.request = (options) => {
|
||||
|
||||
Reference in New Issue
Block a user