diff --git a/pages/API/navigator/new-page/onLoad.test.js b/pages/API/navigator/new-page/onLoad.test.js index f2d2188fd723bd8c2c9675f53e39f47c4d8832b1..1893ca634865ad311af65aa599ce821ac033ef2e 100644 --- a/pages/API/navigator/new-page/onLoad.test.js +++ b/pages/API/navigator/new-page/onLoad.test.js @@ -10,7 +10,9 @@ describe("onLoad", () => { await page.waitFor('view'); await page.callMethod("navigateToOnLoadWithType", "adjustData"); await page.waitFor(1000); - const image = await program.screenshot({fullPage: true}); + const image = await program.screenshot({ + fullPage: true + }); expect(image).toSaveImageSnapshot(); }); it("navigateTo", async () => { @@ -127,4 +129,19 @@ describe("onLoad", () => { failureThresholdType: "percent", }); }); -}); + it('onLoad 参数 decode', async () => { + page = await program.reLaunch(PAGE_PATH); + await page.waitFor("view"); + const TEXT = '中文测试' + uni.navigateTo({ + url: INTERMEDIATE_PAGE_PATH + '?data=' + encodeURIComponent(TEXT), + success() { + + } + }) + await page.waitFor(1000); + page = await program.currentPage(); + const data = await page.data(); + expect(data.data).toBe(TEXT); + }) +});