diff --git a/pages/API/download-file/download-file.test.js b/pages/API/download-file/download-file.test.js index fe16cecef1a034872ed7d587101548dfb6d155b4..eb83f41c0b0fdb4300b1ed4167f2e350f962b5c4 100644 --- a/pages/API/download-file/download-file.test.js +++ b/pages/API/download-file/download-file.test.js @@ -21,7 +21,13 @@ describe('ExtApi-DownloadFile', () => { it('Check ', async () => { expect(res).toBe(true); }); - + + it('Check Special characters Url download file', async () => { + res = await page.callMethod('jest_special_characters_download') + await page.waitFor(2000); + res = await page.data('jest_result'); + expect(res).toBe(true) + }); if (!process.env.uniTestPlatformInfo.startsWith('web')) { it('Check uni.env', async () => { diff --git a/pages/API/download-file/download-file.uvue b/pages/API/download-file/download-file.uvue index 3e2d7fdc7192bd15d5db0b893004de3798ab6887..35cef62843477bf2e39a0949fbbabd1dcd31a97c 100644 --- a/pages/API/download-file/download-file.uvue +++ b/pages/API/download-file/download-file.uvue @@ -149,6 +149,18 @@ } } as CommonOptions) // #endif + }, + jest_special_characters_download(){ + uni.downloadFile({ + url: "https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/1789834995055525889-你好%23你好.png", + success: (res: DownloadFileSuccess) => { + this.jest_result = true; + console.log("res :", res); + }, + fail: () => { + this.jest_result = false; + } + }); } } }