From d240649f983aecb3b58498834a1bb6cdee7c3ebc Mon Sep 17 00:00:00 2001 From: hdx Date: Fri, 24 Nov 2023 15:27:27 +0800 Subject: [PATCH] =?UTF-8?q?node-info:=20=E8=B0=83=E6=95=B4=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E6=B5=8B=E8=AF=95=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=20Android=206=20=E7=9A=84=E4=BE=8B=E5=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/nodes-info/nodes-info.test.js | 34 +++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/pages/API/nodes-info/nodes-info.test.js b/pages/API/nodes-info/nodes-info.test.js index 615fd57a..d6be1f8e 100644 --- a/pages/API/nodes-info/nodes-info.test.js +++ b/pages/API/nodes-info/nodes-info.test.js @@ -19,12 +19,10 @@ describe('nodes-info', () => { const data = await page.data() // TODO 和浏览器的计算存在差异 - if (!process.env.uniTestPlatformInfo.startsWith('android 6')) { - const nodeInfo = data.nodeInfoList[0] - expect(Math.round(nodeInfo.left)).toBe(RECT_LEFT) - expect(Math.round(nodeInfo.width)).toBe(RECT_WIDTH) - expect(Math.round(nodeInfo.height)).toBe(RECT_HEIGHT) - } + const nodeInfo = data.nodeInfoList[0] + expect(Math.round(nodeInfo.left)).toBe(RECT_LEFT) + expect(Math.round(nodeInfo.width)).toBe(RECT_WIDTH) + expect(Math.round(nodeInfo.height)).toBe(RECT_HEIGHT) }) it('get-all-node-info', async () => { const btnGetAllNodeInfo = await page.$('.btn-get-all-node-info') @@ -34,18 +32,16 @@ describe('nodes-info', () => { const data = await page.data() - if (!process.env.uniTestPlatformInfo.startsWith('android 6')) { - const nodeInfo1 = data.nodeInfoList[0] - expect(Math.round(nodeInfo1.left)).toBe(RECT_LEFT) - expect(nodeInfo1.top > 220).toBe(true) - expect(Math.round(nodeInfo1.width)).toBe(RECT_WIDTH) - expect(Math.round(nodeInfo1.height)).toBe(RECT_HEIGHT) - - const nodeInfo2 = data.nodeInfoList[1] - expect(nodeInfo2.left > 200).toBe(true) - expect(nodeInfo2.top > 220).toBe(true) - expect(Math.round(nodeInfo2.width)).toBe(RECT_WIDTH) - expect(Math.round(nodeInfo2.height)).toBe(RECT_HEIGHT) - } + const nodeInfo1 = data.nodeInfoList[0] + expect(Math.round(nodeInfo1.left)).toBe(RECT_LEFT) + expect(nodeInfo1.top > 220).toBe(true) + expect(Math.round(nodeInfo1.width)).toBe(RECT_WIDTH) + expect(Math.round(nodeInfo1.height)).toBe(RECT_HEIGHT) + + const nodeInfo2 = data.nodeInfoList[1] + expect(nodeInfo2.left > 200).toBe(true) + expect(nodeInfo2.top > 220).toBe(true) + expect(Math.round(nodeInfo2.width)).toBe(RECT_WIDTH) + expect(Math.round(nodeInfo2.height)).toBe(RECT_HEIGHT) }) }) -- GitLab