From 4f603ff3d60793ff276ff2c8506c7cfdf29a4a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Thu, 27 Jun 2024 15:30:43 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"test:=20uni.getSystemInfo=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=B5=8B=E8=AF=95=E4=BE=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 280ad5d78759de56266be290ea0eacbc6514d1d7. --- .../API/get-system-info/get-system-info.test.js | 6 ------ pages/API/get-system-info/get-system-info.uvue | 17 +++-------------- 2 files changed, 3 insertions(+), 20 deletions(-) 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 6b340e31..9cc4c2da 100644 --- a/pages/API/get-system-info/get-system-info.test.js +++ b/pages/API/get-system-info/get-system-info.test.js @@ -63,10 +63,4 @@ describe('ExtApi-GetSystemInfo', () => { expect(`${key} not null: ${res[key] != null}`).toBe(`${key} not null: true`) } }) - - it('Check screenHeight at different stages', async ()=> { - await page.callMethod('jest_getScreenHeight_at_different_stages') - res = await page.data('jest_result'); - expect(res).toBe(true) - }) }); diff --git a/pages/API/get-system-info/get-system-info.uvue b/pages/API/get-system-info/get-system-info.uvue index 022c54d5..f1115d1d 100644 --- a/pages/API/get-system-info/get-system-info.uvue +++ b/pages/API/get-system-info/get-system-info.uvue @@ -37,23 +37,15 @@ type Item = { label : string, value : string, - } - const globalScreenHeight = uni.getSystemInfoSync().screenHeight + } export default { data() { return { title: 'getSystemInfo', - items: [] as Item[], - screenHeightAtReady: 0, - jest_result: false, + items: [] as Item[], } }, onUnload: function () { - }, - - onReady() { - this.screenHeightAtReady = uni.getSystemInfoSync().screenHeight - console.log(`全局获取屏幕高度: ${globalScreenHeight} onReady内获取屏幕高度: ${this.screenHeightAtReady}`); }, methods: { getSystemInfo: function () { @@ -104,10 +96,7 @@ //自动化测试例专用 jest_getSystemInfo() : GetSystemInfoResult { return uni.getSystemInfoSync(); - }, - jest_getScreenHeight_at_different_stages(){ - this.jest_result = (globalScreenHeight == this.screenHeightAtReady) - } + }, } } -- GitLab