Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
53136d0d
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
53136d0d
编写于
8月 20, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 20, 2021
浏览文件
操作
浏览文件
下载
差异文件
!453 修改电源子系统JS接口测试用例部分判断方法不规范的问题
Merge pull request !453 from 梁启航/master
上级
e7b1917e
366a00d9
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
24 addition
and
24 deletion
+24
-24
powermgr/powermgrbattery/project/entry/src/main/js/test/battery_unit.test.js
...ttery/project/entry/src/main/js/test/battery_unit.test.js
+24
-24
未找到文件。
powermgr/powermgrbattery/project/entry/src/main/js/test/battery_unit.test.js
浏览文件 @
53136d0d
/*
+
137
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -29,10 +29,10 @@ describe('appInfoTest', function () {
...
@@ -29,10 +29,10 @@ describe('appInfoTest', function () {
it
(
'
battery_soc_test
'
,
0
,
function
()
{
it
(
'
battery_soc_test
'
,
0
,
function
()
{
var
batterySoc
=
batteryInfo
.
batterySOC
;
var
batterySoc
=
batteryInfo
.
batterySOC
;
console
.
info
(
'
batterySoc =
'
+
batterySoc
);
console
.
info
(
'
batterySoc =
'
+
batterySoc
);
expect
(
batterySoc
>=
-
1
&&
batterySoc
<=
100
).
assert
Equal
(
'
1
'
)
expect
(
batterySoc
>=
-
1
&&
batterySoc
<=
100
).
assert
True
(
)
})
})
/**
06
-+
5
/**
* @tc.number battery_manager_js_0200
* @tc.number battery_manager_js_0200
* @tc.name charging_status_test
* @tc.name charging_status_test
* @tc.desc Battery charging kit
* @tc.desc Battery charging kit
...
@@ -40,7 +40,7 @@ describe('appInfoTest', function () {
...
@@ -40,7 +40,7 @@ describe('appInfoTest', function () {
it
(
'
charging_status_test
'
,
0
,
function
()
{
it
(
'
charging_status_test
'
,
0
,
function
()
{
var
chargingStatus
=
batteryInfo
.
chargingStatus
;
var
chargingStatus
=
batteryInfo
.
chargingStatus
;
console
.
info
(
'
chargingStatus =
'
+
chargingStatus
);
console
.
info
(
'
chargingStatus =
'
+
chargingStatus
);
expect
(
chargingStatus
>=
0
&&
chargingStatus
<=
4
).
assert
Equal
(
'
1
'
)
expect
(
chargingStatus
>=
0
&&
chargingStatus
<=
4
).
assert
True
(
)
})
})
/**
/**
...
@@ -51,7 +51,7 @@ describe('appInfoTest', function () {
...
@@ -51,7 +51,7 @@ describe('appInfoTest', function () {
it
(
'
health_status_test
'
,
0
,
function
()
{
it
(
'
health_status_test
'
,
0
,
function
()
{
var
healthStatus
=
batteryInfo
.
healthStatus
;
var
healthStatus
=
batteryInfo
.
healthStatus
;
console
.
info
(
'
healthStatus =
'
+
healthStatus
);
console
.
info
(
'
healthStatus =
'
+
healthStatus
);
expect
(
healthStatus
>=
0
&&
healthStatus
<=
6
).
assert
Equal
(
'
1
'
)
expect
(
healthStatus
>=
0
&&
healthStatus
<=
6
).
assert
True
(
)
})
})
/**
/**
...
@@ -62,18 +62,18 @@ describe('appInfoTest', function () {
...
@@ -62,18 +62,18 @@ describe('appInfoTest', function () {
it
(
'
plugged_type_test
'
,
0
,
function
()
{
it
(
'
plugged_type_test
'
,
0
,
function
()
{
var
pluggedType
=
batteryInfo
.
pluggedType
;
var
pluggedType
=
batteryInfo
.
pluggedType
;
console
.
info
(
'
pluggedType =
'
+
pluggedType
);
console
.
info
(
'
pluggedType =
'
+
pluggedType
);
expect
(
pluggedType
>=
0
&&
pluggedType
<=
4
).
assert
Equal
(
'
1
'
)
expect
(
pluggedType
>=
0
&&
pluggedType
<=
4
).
assert
True
(
)
})
})
/**
/**
* @tc.number battery_manager_js_0500
* @t
🐎
c.number battery_manager_js_0500
* @tc.name voltage_test
* @tc.name voltage_test
* @tc.desc Obtaining the Voltage Interface KIT
* @tc.desc Obtaining the Voltage Interface KIT
*/
*/
it
(
'
voltage_test
'
,
0
,
function
()
{
it
(
'
voltage_test
'
,
0
,
function
()
{
var
voltage
=
batteryInfo
.
voltage
;
var
voltage
=
batteryInfo
.
voltage
;
console
.
info
(
'
voltage =
'
+
voltage
);
console
.
info
(
'
voltage =
'
+
voltage
);
expect
(
voltage
>=
-
1
).
assert
Equal
(
'
1
'
)
expect
(
voltage
>=
-
1
).
assert
True
(
)
})
})
/**
/**
...
@@ -84,7 +84,7 @@ describe('appInfoTest', function () {
...
@@ -84,7 +84,7 @@ describe('appInfoTest', function () {
it
(
'
technology_test
'
,
0
,
function
()
{
it
(
'
technology_test
'
,
0
,
function
()
{
var
technology
=
batteryInfo
.
technology
;
var
technology
=
batteryInfo
.
technology
;
console
.
info
(
'
technology =
'
+
technology
);
console
.
info
(
'
technology =
'
+
technology
);
expect
(
0
).
assertEqual
(
'
0
'
)
expect
(
technology
!==
null
).
assertTrue
(
)
})
})
/**
/**
...
@@ -95,7 +95,7 @@ describe('appInfoTest', function () {
...
@@ -95,7 +95,7 @@ describe('appInfoTest', function () {
it
(
'
battery_temperature_test
'
,
0
,
function
()
{
it
(
'
battery_temperature_test
'
,
0
,
function
()
{
var
batteryTemperature
=
batteryInfo
.
batteryTemperature
;
var
batteryTemperature
=
batteryInfo
.
batteryTemperature
;
console
.
info
(
'
batteryTemperature =
'
+
batteryTemperature
);
console
.
info
(
'
batteryTemperature =
'
+
batteryTemperature
);
expect
(
batteryTemperature
<=
100
).
assert
Equal
(
'
1
'
)
expect
(
batteryTemperature
<=
100
).
assert
True
(
)
})
})
/**
/**
...
@@ -106,7 +106,7 @@ describe('appInfoTest', function () {
...
@@ -106,7 +106,7 @@ describe('appInfoTest', function () {
it
(
'
enum_health_state_test_unknown
'
,
0
,
function
()
{
it
(
'
enum_health_state_test_unknown
'
,
0
,
function
()
{
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
UNKNOWN
;
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
UNKNOWN
;
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
expect
(
batteryHealthState
==
0
).
assert
Equal
(
'
1
'
)
expect
(
batteryHealthState
==
0
).
assert
True
(
)
})
})
/**
/**
...
@@ -117,7 +117,7 @@ describe('appInfoTest', function () {
...
@@ -117,7 +117,7 @@ describe('appInfoTest', function () {
it
(
'
enum_health_state_test_good
'
,
0
,
function
()
{
it
(
'
enum_health_state_test_good
'
,
0
,
function
()
{
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
GOOD
;
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
GOOD
;
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
expect
(
batteryHealthState
==
1
).
assert
Equal
(
'
1
'
)
expect
(
batteryHealthState
==
1
).
assert
True
(
)
})
})
/**
/**
...
@@ -128,7 +128,7 @@ describe('appInfoTest', function () {
...
@@ -128,7 +128,7 @@ describe('appInfoTest', function () {
it
(
'
enum_health_state_test_overheat
'
,
0
,
function
()
{
it
(
'
enum_health_state_test_overheat
'
,
0
,
function
()
{
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
OVERHEAT
;
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
OVERHEAT
;
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
expect
(
batteryHealthState
==
2
).
assert
Equal
(
'
1
'
)
expect
(
batteryHealthState
==
2
).
assert
True
(
)
})
})
/**
/**
...
@@ -139,7 +139,7 @@ describe('appInfoTest', function () {
...
@@ -139,7 +139,7 @@ describe('appInfoTest', function () {
it
(
'
enum_health_state_test_overvoltage
'
,
0
,
function
()
{
it
(
'
enum_health_state_test_overvoltage
'
,
0
,
function
()
{
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
OVERVOLTAGE
;
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
OVERVOLTAGE
;
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
expect
(
batteryHealthState
==
3
).
assert
Equal
(
'
1
'
)
expect
(
batteryHealthState
==
3
).
assert
True
(
)
})
})
/**
/**
...
@@ -150,7 +150,7 @@ describe('appInfoTest', function () {
...
@@ -150,7 +150,7 @@ describe('appInfoTest', function () {
it
(
'
enum_health_state_test_cold
'
,
0
,
function
()
{
it
(
'
enum_health_state_test_cold
'
,
0
,
function
()
{
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
COLD
;
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
COLD
;
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
expect
(
batteryHealthState
==
4
).
assert
Equal
(
'
1
'
)
expect
(
batteryHealthState
==
4
).
assert
True
(
)
})
})
/**
/**
...
@@ -161,7 +161,7 @@ describe('appInfoTest', function () {
...
@@ -161,7 +161,7 @@ describe('appInfoTest', function () {
it
(
'
enum_health_state_test_dead
'
,
0
,
function
()
{
it
(
'
enum_health_state_test_dead
'
,
0
,
function
()
{
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
DEAD
;
var
batteryHealthState
=
batteryInfo
.
BatteryHealthState
.
DEAD
;
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
console
.
info
(
'
batteryHealthState =
'
+
batteryHealthState
);
expect
(
batteryHealthState
==
5
).
assert
Equal
(
'
1
'
)
expect
(
batteryHealthState
==
5
).
assert
True
(
)
})
})
/**
/**
...
@@ -172,7 +172,7 @@ describe('appInfoTest', function () {
...
@@ -172,7 +172,7 @@ describe('appInfoTest', function () {
it
(
'
enum_charge_state_test_none
'
,
0
,
function
()
{
it
(
'
enum_charge_state_test_none
'
,
0
,
function
()
{
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
NONE
;
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
NONE
;
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
expect
(
batteryChargeState
==
0
).
assert
Equal
(
'
1
'
)
expect
(
batteryChargeState
==
0
).
assert
True
(
)
})
})
/**
/**
...
@@ -183,7 +183,7 @@ describe('appInfoTest', function () {
...
@@ -183,7 +183,7 @@ describe('appInfoTest', function () {
it
(
'
enum_charge_state_test_enable
'
,
0
,
function
()
{
it
(
'
enum_charge_state_test_enable
'
,
0
,
function
()
{
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
ENABLE
;
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
ENABLE
;
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
expect
(
batteryChargeState
==
1
).
assert
Equal
(
'
1
'
)
expect
(
batteryChargeState
==
1
).
assert
True
(
)
})
})
/**
/**
...
@@ -194,7 +194,7 @@ describe('appInfoTest', function () {
...
@@ -194,7 +194,7 @@ describe('appInfoTest', function () {
it
(
'
enum_charge_state_test_disable
'
,
0
,
function
()
{
it
(
'
enum_charge_state_test_disable
'
,
0
,
function
()
{
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
DISABLE
;
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
DISABLE
;
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
expect
(
batteryChargeState
==
2
).
assert
Equal
(
'
1
'
)
expect
(
batteryChargeState
==
2
).
assert
True
(
)
})
})
/**
/**
...
@@ -205,7 +205,7 @@ describe('appInfoTest', function () {
...
@@ -205,7 +205,7 @@ describe('appInfoTest', function () {
it
(
'
enum_charge_state_test_full
'
,
0
,
function
()
{
it
(
'
enum_charge_state_test_full
'
,
0
,
function
()
{
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
FULL
;
var
batteryChargeState
=
batteryInfo
.
BatteryChargeState
.
FULL
;
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
console
.
info
(
'
batteryChargeState =
'
+
batteryChargeState
);
expect
(
batteryChargeState
==
3
).
assert
Equal
(
'
1
'
)
expect
(
batteryChargeState
==
3
).
assert
True
(
)
})
})
/**
/**
...
@@ -216,7 +216,7 @@ describe('appInfoTest', function () {
...
@@ -216,7 +216,7 @@ describe('appInfoTest', function () {
it
(
'
enum_plugged_type_test_none
'
,
0
,
function
()
{
it
(
'
enum_plugged_type_test_none
'
,
0
,
function
()
{
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
NONE
;
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
NONE
;
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
expect
(
batteryPluggedType
==
0
).
assert
Equal
(
'
1
'
)
expect
(
batteryPluggedType
==
0
).
assert
True
(
)
})
})
/**
/**
...
@@ -227,7 +227,7 @@ describe('appInfoTest', function () {
...
@@ -227,7 +227,7 @@ describe('appInfoTest', function () {
it
(
'
enum_plugged_type_test_ac
'
,
0
,
function
()
{
it
(
'
enum_plugged_type_test_ac
'
,
0
,
function
()
{
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
AC
;
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
AC
;
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
expect
(
batteryPluggedType
==
1
).
assert
Equal
(
'
1
'
)
expect
(
batteryPluggedType
==
1
).
assert
True
(
)
})
})
/**
/**
...
@@ -238,7 +238,7 @@ describe('appInfoTest', function () {
...
@@ -238,7 +238,7 @@ describe('appInfoTest', function () {
it
(
'
enum_plugged_type_test_usb
'
,
0
,
function
()
{
it
(
'
enum_plugged_type_test_usb
'
,
0
,
function
()
{
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
USB
;
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
USB
;
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
expect
(
batteryPluggedType
==
2
).
assert
Equal
(
'
1
'
)
expect
(
batteryPluggedType
==
2
).
assert
True
(
)
})
})
/**
/**
...
@@ -249,7 +249,7 @@ describe('appInfoTest', function () {
...
@@ -249,7 +249,7 @@ describe('appInfoTest', function () {
it
(
'
enum_plugged_type_test_wireless
'
,
0
,
function
()
{
it
(
'
enum_plugged_type_test_wireless
'
,
0
,
function
()
{
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
WIRELESS
;
var
batteryPluggedType
=
batteryInfo
.
BatteryPluggedType
.
WIRELESS
;
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
console
.
info
(
'
batteryPluggedType =
'
+
batteryPluggedType
);
expect
(
batteryPluggedType
==
3
).
assert
Equal
(
'
1
'
)
expect
(
batteryPluggedType
==
3
).
assert
True
(
)
})
})
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录