From 46b02b07eebb9346905978b914e38534edaf84ab Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Thu, 26 Sep 2024 19:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0getWindowInfo=E3=80=81getSyst?= =?UTF-8?q?emInfo=E8=87=AA=E5=8A=A8=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/get-system-info/get-system-info.test.js | 7 +++++++ pages/API/get-window-info/get-window-info.test.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/pages/API/get-system-info/get-system-info.test.js b/pages/API/get-system-info/get-system-info.test.js index b5a99943..5b211de1 100644 --- a/pages/API/get-system-info/get-system-info.test.js +++ b/pages/API/get-system-info/get-system-info.test.js @@ -56,6 +56,13 @@ describe('ExtApi-GetSystemInfo', () => { expect(['light', 'dark', 'auto']).toContain(value); } } + if (process.env.uniTestPlatformInfo.startsWith('android')) { + if (res.safeAreaInsets.bottom > 0) { + expect(res.safeAreaInsets.top + 44 + res.windowHeight).toBe(res.screenHeight); + } else { + expect(res.safeAreaInsets.top + 44 + res.windowHeight).toBe(res.safeArea.bottom); + } + } }); it('Check GetSystemInfoSync required properties', async () => { for (let i = 0; i < requiredProperties.length; i++) { diff --git a/pages/API/get-window-info/get-window-info.test.js b/pages/API/get-window-info/get-window-info.test.js index a6a63617..c6e223e8 100644 --- a/pages/API/get-window-info/get-window-info.test.js +++ b/pages/API/get-window-info/get-window-info.test.js @@ -23,6 +23,13 @@ describe('ExtApi-GetWindowInfo', () => { if (numberProperties.indexOf(key) != -1) { expect(value).toBeGreaterThanOrEqual(0); } + } + if (process.env.uniTestPlatformInfo.startsWith('android')) { + if (res.safeAreaInsets.bottom > 0) { + expect(res.safeAreaInsets.top + 44 + res.windowHeight).toBe(res.screenHeight); + } else { + expect(res.safeAreaInsets.top + 44 + res.windowHeight).toBe(res.safeArea.bottom); + } } }); }); -- GitLab