diff --git a/pages/API/get-app-base-info/get-app-base-info.test.js b/pages/API/get-app-base-info/get-app-base-info.test.js index b0a255f3b0c91048514b32b15b316c1e41a34e59..4c61b7bfafed7d025d8eae7c882c4c567bb34d49 100644 --- a/pages/API/get-app-base-info/get-app-base-info.test.js +++ b/pages/API/get-app-base-info/get-app-base-info.test.js @@ -18,12 +18,14 @@ describe('ExtApi-GetAppBaseInfo', () => { }); it('Check properties', async () => { for (const key in res) { - const value = res[key]; - expect(value).not.toBeNull(); - if (stringProperties.indexOf(key) != -1) { + const value = res[key]; + console.log("key :",key , "value :", value); + if (stringProperties.indexOf(key) != -1) { + expect(value).not.toBeNull(); expect(value).not.toBe(""); } - if (numberProperties.indexOf(key) != -1) { + if (numberProperties.indexOf(key) != -1) { + expect(value).not.toBeNull(); expect(value).toBeGreaterThanOrEqual(3.90); } } diff --git a/pages/API/get-device-info/get-device-info.test.js b/pages/API/get-device-info/get-device-info.test.js index 6776ab30a61e09848c15acda57eb563dabbcddc9..d0027337dc8c0ca9d760314ea6abf8796dd6ac1b 100644 --- a/pages/API/get-device-info/get-device-info.test.js +++ b/pages/API/get-device-info/get-device-info.test.js @@ -13,14 +13,16 @@ describe('ExtApi-GetDeviceInfo', () => { await page.waitFor(600); res = await uni.getDeviceInfo(); }); - it('Check properties', async () => { + it('Check properties', async () => { for (const key in res) { - const value = res[key]; - expect(value).not.toBeNull(); - if (stringProperties.indexOf(key) != -1) { + const value = res[key]; + console.log("key :",key , "value :", value); + if (stringProperties.indexOf(key) != -1) { + expect(value).not.toBeNull(); expect(value).not.toBe(""); } - if (key == 'deviceOrientation') { + if (key == 'deviceOrientation') { + expect(value).not.toBeNull(); expect(['portrait', 'landscape']).toContain(value); } } 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 7e9685bfb238f7b9c363ae12a03a1f5f7131634f..5a614780afe15fe8a0b92e7dddf241f0b42d883d 100644 --- a/pages/API/get-system-info/get-system-info.test.js +++ b/pages/API/get-system-info/get-system-info.test.js @@ -25,11 +25,13 @@ describe('ExtApi-GetSystemInfo', () => { it('Check GetSystemInfoSync', async () => { for (const key in res) { const value = res[key]; - expect(value).not.toBeNull(); + console.log("key :",key , "value :", value); if (stringProperties.indexOf(key) != -1) { + expect(value).not.toBeNull(); expect(value).not.toBe(""); } if (numberProperties.indexOf(key) != -1) { + expect(value).not.toBeNull(); expect(value).toBeGreaterThanOrEqual(0); } if (key == 'deviceOrientation') { @@ -37,4 +39,4 @@ describe('ExtApi-GetSystemInfo', () => { } } }); -}); \ No newline at end of file +}); diff --git a/pages/API/get-system-setting/get-system-setting.uvue b/pages/API/get-system-setting/get-system-setting.uvue index b3d348ea06d603f19cedb5fea5b938fdb5110fa4..253d6e0d85df8513d29e46b707c998754719a701 100644 --- a/pages/API/get-system-setting/get-system-setting.uvue +++ b/pages/API/get-system-setting/get-system-setting.uvue @@ -61,9 +61,9 @@ getSystemSetting: function () { const res = uni.getSystemSetting(); this.bluetoothEnabled = (res.bluetoothEnabled ?? false) ? "开启" : "关闭"; - this.locationEnabled = (res.locationEnabled ?? false) ? "开启" : "关闭"; + this.locationEnabled = res.locationEnabled ? "开启" : "关闭"; this.wifiEnabled = (res.wifiEnabled ?? false) ? "开启" : "关闭"; - this.deviceOrientation = res.deviceOrientation ?? ""; + this.deviceOrientation = res.deviceOrientation } } }