From 253b393f6ce1536b95c70127172ebadecc4d96fe Mon Sep 17 00:00:00 2001 From: Otto Date: Sat, 10 Aug 2024 17:37:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=20onLoad=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=A7=A3=E7=A0=81=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/navigator/new-page/onLoad.test.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pages/API/navigator/new-page/onLoad.test.js b/pages/API/navigator/new-page/onLoad.test.js index f2d2188f..1893ca63 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); + }) +}); -- GitLab