Merge branch 'release/test' of http://8.163.30.128:10082/html/pda-overseas-uniapp into release/test

This commit is contained in:
2026-09-17 13:36:11 +08:00
8 changed files with 46 additions and 11 deletions
+15
View File
@@ -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) => {