From 610896abd5c4d956fe5aac43b6d21e73c8e87c7c Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Sat, 9 Dec 2023 11:39:33 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BC=98=E5=8C=96=20onLoad=20=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/navigator/new-page/onLoad.test.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pages/API/navigator/new-page/onLoad.test.js b/pages/API/navigator/new-page/onLoad.test.js index e44b8d81..c84b3cf3 100644 --- a/pages/API/navigator/new-page/onLoad.test.js +++ b/pages/API/navigator/new-page/onLoad.test.js @@ -66,7 +66,10 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toMatchImageSnapshot({ + failureThreshold: 0.05, + failureThresholdType: "percent", + }); await page.waitFor("view"); }); it("showLoading", async () => { @@ -82,7 +85,10 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toMatchImageSnapshot({ + failureThreshold: 0.05, + failureThresholdType: "percent", + }); }); it("showModal", async () => { page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); @@ -97,7 +103,10 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toMatchImageSnapshot({ + failureThreshold: 0.05, + failureThresholdType: "percent", + }); }); it("showActionSheet", async () => { page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); @@ -112,6 +121,9 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toMatchImageSnapshot({ + failureThreshold: 0.05, + failureThresholdType: "percent", + }); }); }); -- GitLab