提交 253b393f 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊 提交者: 辛宝Otto

feat: 补充 onLoad 参数解码测试

上级 c3e5cb5c
......@@ -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);
})
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册