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

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

上级 007ef7ba
......@@ -19,11 +19,13 @@ describe('ExtApi-GetAppBaseInfo', () => {
it('Check properties', 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(3.90);
}
}
......
......@@ -16,11 +16,13 @@ describe('ExtApi-GetDeviceInfo', () => {
it('Check properties', 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 (key == 'deviceOrientation') {
expect(value).not.toBeNull();
expect(['portrait', 'landscape']).toContain(value);
}
}
......
......@@ -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') {
......
......@@ -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
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册