提交 96f630a6 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

fix: 1. 修改测试用例 2. 去除warning

上级 007ef7ba
...@@ -18,12 +18,14 @@ describe('ExtApi-GetAppBaseInfo', () => { ...@@ -18,12 +18,14 @@ describe('ExtApi-GetAppBaseInfo', () => {
}); });
it('Check properties', async () => { it('Check properties', async () => {
for (const key in res) { for (const key in res) {
const value = res[key]; const value = res[key];
expect(value).not.toBeNull(); console.log("key :",key , "value :", value);
if (stringProperties.indexOf(key) != -1) { if (stringProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(value).not.toBe(""); expect(value).not.toBe("");
} }
if (numberProperties.indexOf(key) != -1) { if (numberProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(value).toBeGreaterThanOrEqual(3.90); expect(value).toBeGreaterThanOrEqual(3.90);
} }
} }
......
...@@ -13,14 +13,16 @@ describe('ExtApi-GetDeviceInfo', () => { ...@@ -13,14 +13,16 @@ describe('ExtApi-GetDeviceInfo', () => {
await page.waitFor(600); await page.waitFor(600);
res = await uni.getDeviceInfo(); res = await uni.getDeviceInfo();
}); });
it('Check properties', async () => { it('Check properties', async () => {
for (const key in res) { for (const key in res) {
const value = res[key]; const value = res[key];
expect(value).not.toBeNull(); console.log("key :",key , "value :", value);
if (stringProperties.indexOf(key) != -1) { if (stringProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(value).not.toBe(""); expect(value).not.toBe("");
} }
if (key == 'deviceOrientation') { if (key == 'deviceOrientation') {
expect(value).not.toBeNull();
expect(['portrait', 'landscape']).toContain(value); expect(['portrait', 'landscape']).toContain(value);
} }
} }
......
...@@ -25,11 +25,13 @@ describe('ExtApi-GetSystemInfo', () => { ...@@ -25,11 +25,13 @@ describe('ExtApi-GetSystemInfo', () => {
it('Check GetSystemInfoSync', async () => { it('Check GetSystemInfoSync', async () => {
for (const key in res) { for (const key in res) {
const value = res[key]; const value = res[key];
expect(value).not.toBeNull(); console.log("key :",key , "value :", value);
if (stringProperties.indexOf(key) != -1) { if (stringProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(value).not.toBe(""); expect(value).not.toBe("");
} }
if (numberProperties.indexOf(key) != -1) { if (numberProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(value).toBeGreaterThanOrEqual(0); expect(value).toBeGreaterThanOrEqual(0);
} }
if (key == 'deviceOrientation') { if (key == 'deviceOrientation') {
...@@ -37,4 +39,4 @@ describe('ExtApi-GetSystemInfo', () => { ...@@ -37,4 +39,4 @@ describe('ExtApi-GetSystemInfo', () => {
} }
} }
}); });
}); });
\ No newline at end of file
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
getSystemSetting: function () { getSystemSetting: function () {
const res = uni.getSystemSetting(); const res = uni.getSystemSetting();
this.bluetoothEnabled = (res.bluetoothEnabled ?? false) ? "开启" : "关闭"; this.bluetoothEnabled = (res.bluetoothEnabled ?? false) ? "开启" : "关闭";
this.locationEnabled = (res.locationEnabled ?? false) ? "开启" : "关闭"; this.locationEnabled = res.locationEnabled ? "开启" : "关闭";
this.wifiEnabled = (res.wifiEnabled ?? false) ? "开启" : "关闭"; this.wifiEnabled = (res.wifiEnabled ?? false) ? "开启" : "关闭";
this.deviceOrientation = res.deviceOrientation ?? ""; this.deviceOrientation = res.deviceOrientation
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册