This commit is contained in:
2026-09-20 14:43:33 +08:00
parent 3ba8809222
commit 4dc8899086
2 changed files with 17 additions and 1 deletions
+14
View File
@@ -274,6 +274,20 @@ test('authenticated photo download maps the public api path through the H5 overs
assert.equal(calls[0].header.Authorization, `Bearer ${value.overseasAccessToken}`)
})
test('native image download accepts a valid temp file when App-Plus omits response headers', async () => {
prepareSession()
globalThis.uni.downloadFile = (options) => options.success({
statusCode: 200,
tempFilePath: '_doc/uniapp_temp/photo.jpg',
header: {}
})
assert.equal(
await overseasDownload('/api/pda/v1/last-leg/photo', { expectedContentTypePrefix: 'image/' }),
'_doc/uniapp_temp/photo.jpg'
)
})
test('image download rejects a JSON error envelope returned with HTTP 200', async () => {
prepareSession()
globalThis.uni.downloadFile = (options) => options.success({