提交 02feaf0d 编写于 作者: S ShiJie

test: Modify test case failure

Signed-off-by: NShiJie <shijie20@huawei.com>
Change-Id: I63bab2d3a171f5c7541648c97527cdf1c1affd06
上级 9b94a21d
...@@ -17,12 +17,8 @@ import brightness from '@system.brightness'; ...@@ -17,12 +17,8 @@ import brightness from '@system.brightness';
import { describe } from 'deccjsunit/index'; import { describe } from 'deccjsunit/index';
const INPUT_ERROR_CODE_CODE = 202; const INPUT_ERROR_CODE_CODE = 202;
const SET_VALUE_MSG = "setValue: value is not an available number"; const SET_VALUE_MSG = "value is not an available number";
const SET_MODE_MSG = "setMode: value is not an available number"; const SET_MODE_MSG = "value is not an available number";
function isNotSupported(data) {
return data === "setMode: Auto adjusting brightness is not supported";
}
function sleep(time){ function sleep(time){
return new Promise((resolve) => setTimeout(resolve, time)); return new Promise((resolve) => setTimeout(resolve, time));
...@@ -206,7 +202,7 @@ describe('appInfoTest_display', function () { ...@@ -206,7 +202,7 @@ describe('appInfoTest_display', function () {
mode: modeVal ? 0 : 1, mode: modeVal ? 0 : 1,
fail: (data, code) => { fail: (data, code) => {
console.log("get_mode_success, data: " + data + ", code: " + code); console.log("get_mode_success, data: " + data + ", code: " + code);
exec = isNotSupported(data) ? false : true; exec = false;
} }
}) })
if (!exec) { if (!exec) {
...@@ -269,15 +265,6 @@ describe('appInfoTest_display', function () { ...@@ -269,15 +265,6 @@ describe('appInfoTest_display', function () {
} }
}); });
}, },
fail: (data, code) => {
if (!isNotSupported(data)) {
console.log("set_mode_success, data: " + data + ", code: " + code);
expect().assertFail();
} else {
console.log("set_mode_success not supported");
expect(isNotSupported(data)).assertTrue();
}
},
complete: () => { complete: () => {
console.log("The device information is obtained successfully. Procedure"); console.log("The device information is obtained successfully. Procedure");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册