Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9285728a
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看板
未验证
提交
9285728a
编写于
1月 22, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1654 【XTS】【事件通知子系统】修复免打扰用例
Merge pull request !1654 from dwq/master
上级
0d4e2b02
29e5259c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
196 addition
and
59 deletion
+196
-59
notification/ans_standard/publish_test/donotdisturbmode/entry/src/main/js/test/doNotDisturbTest.js
...notdisturbmode/entry/src/main/js/test/doNotDisturbTest.js
+195
-59
xts_acts
xts_acts
+1
-0
未找到文件。
notification/ans_standard/publish_test/donotdisturbmode/entry/src/main/js/test/doNotDisturbTest.js
浏览文件 @
9285728a
...
@@ -79,8 +79,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -79,8 +79,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_0300
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
16
,
52
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
18
,
33
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
8
,
beginDate
.
getMinutes
())
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
begin
:
beginDate
,
...
@@ -103,8 +107,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -103,8 +107,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_0400
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
10
,
6
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
18
,
46
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
8
,
beginDate
.
getMinutes
()
+
20
)
notify
.
setDoNotDisturbDate
({
notify
.
setDoNotDisturbDate
({
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
begin
:
beginDate
,
...
@@ -126,8 +134,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -126,8 +134,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_0500
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
12
,
10
);
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
18
,
42
);
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
8
,
beginDate
.
getMinutes
())
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
type
:
notify
.
DoNotDisturbType
.
TYPE_ONCE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_ONCE
,
begin
:
beginDate
,
begin
:
beginDate
,
...
@@ -137,8 +149,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -137,8 +149,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_0500 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_0500 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
1
);
expect
(
data
.
type
).
assertEqual
(
1
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 12:10:00 GMT+0000
"
);
var
DoNotDateE
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 18:42:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
console
.
log
(
"
===>getDoNotDisturbDate DoNotDateE===>
"
+
DoNotDateE
)
console
.
log
(
"
===>getDoNotDisturbDate beginDate===>
"
+
data
.
begin
)
console
.
log
(
"
===>getDoNotDisturbDate endDate===>
"
+
data
.
end
)
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateE
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -156,18 +176,30 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -156,18 +176,30 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_0600
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
8
,
13
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
18
,
42
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
6
,
beginDate
.
getMinutes
())
notify
.
setDoNotDisturbDate
({
notify
.
setDoNotDisturbDate
({
type
:
notify
.
DoNotDisturbType
.
TYPE_ONCE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_ONCE
,
begin
:
beginDate
,
begin
:
beginDate
,
end
:
endDate
end
:
endDate
}).
then
(
}).
then
(
await
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_0600 success===>
"
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_0600 success===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
1
);
expect
(
data
.
type
).
assertEqual
(
1
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 08:13:00 GMT+0000
"
);
var
DoNotDateF
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 18:42:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
console
.
log
(
"
===>test_0600 begin===>
"
+
DoNotDateF
)
console
.
log
(
"
===>test_0600 beginDate===>
"
+
data
.
begin
)
console
.
log
(
"
===>test_0600 endDate===>
"
+
data
.
end
)
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateF
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -185,8 +217,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -185,8 +217,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_0700
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
8
,
18
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
24
,
46
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
7
,
beginDate
.
getMinutes
()
+
36
)
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
type
:
notify
.
DoNotDisturbType
.
TYPE_DAILY
,
type
:
notify
.
DoNotDisturbType
.
TYPE_DAILY
,
begin
:
beginDate
,
begin
:
beginDate
,
...
@@ -196,8 +232,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -196,8 +232,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_0700 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_0700 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
var
DoNotDateG
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
console
.
log
(
"
===>0700 begin===>
"
+
DoNotDateG
)
console
.
log
(
"
===>0700 beginDate===>
"
+
data
.
begin
)
console
.
log
(
"
===>0700 endDate===>
"
+
data
.
end
)
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateG
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -215,8 +259,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -215,8 +259,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of displayBadge
* @tc.desc: verify the function of displayBadge
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_0800
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_0800
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
18
,
16
,
12
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
19
,
16
,
12
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
13
,
beginDate
.
getMinutes
()
+
48
)
console
.
log
(
"
===>ActsSetDoNotDisturbTest_test_0800 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>ActsSetDoNotDisturbTest_test_0800 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>ActsSetDoNotDisturbTest_test_0800 endDate ===>
"
+
endDate
)
console
.
log
(
"
===>ActsSetDoNotDisturbTest_test_0800 endDate ===>
"
+
endDate
)
notify
.
setDoNotDisturbDate
({
notify
.
setDoNotDisturbDate
({
...
@@ -227,8 +275,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -227,8 +275,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_0800 success===>
"
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_0800 success===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sat Dec 18 2021 16:12:00 GMT+0000
"
);
var
DoNotDateH
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
console
.
log
(
"
===>0800 begin===>
"
+
DoNotDateH
)
console
.
log
(
"
===>0800 beginDate===>
"
+
data
.
begin
)
console
.
log
(
"
===>0800 endDate===>
"
+
data
.
end
)
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateH
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -246,8 +302,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -246,8 +302,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_0900
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_0900
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
12
,
12
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
19
,
16
,
12
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
4
,
beginDate
.
getMinutes
())
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
type
:
notify
.
DoNotDisturbType
.
TYPE_CLEARLY
,
type
:
notify
.
DoNotDisturbType
.
TYPE_CLEARLY
,
begin
:
beginDate
,
begin
:
beginDate
,
...
@@ -257,8 +317,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -257,8 +317,16 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_0900 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_0900 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 12:12:00 GMT+0000
"
);
var
DoNotDateI
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
console
.
log
(
"
===>test_0900 begin===>
"
+
DoNotDateI
)
console
.
log
(
"
===>test_0900 beginDate===>
"
+
data
.
begin
)
console
.
log
(
"
===>test_0900 endDate===>
"
+
data
.
end
)
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateI
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -276,8 +344,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -276,8 +344,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of displayBadge
* @tc.desc: verify the function of displayBadge
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_1000
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_1000
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
8
,
18
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
24
,
46
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
6
,
beginDate
.
getMinutes
()
+
32
)
console
.
log
(
"
===>test_1000 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1000 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1000 endDate ===>
"
+
endDate
)
console
.
log
(
"
===>test_1000 endDate ===>
"
+
endDate
)
notify
.
setDoNotDisturbDate
({
notify
.
setDoNotDisturbDate
({
...
@@ -285,11 +357,19 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -285,11 +357,19 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin
:
beginDate
,
begin
:
beginDate
,
end
:
endDate
end
:
endDate
}).
then
(
}).
then
(
await
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_1000 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_1000 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
var
DoNotDateJ
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
console
.
log
(
"
===>test_1000 begin===>
"
+
DoNotDateJ
)
console
.
log
(
"
===>test_1000 beginDate===>
"
+
data
.
begin
)
console
.
log
(
"
===>test_1000 endDate===>
"
+
data
.
end
)
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateJ
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -307,8 +387,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -307,8 +387,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_1100
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_1100
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
22
,
12
,
18
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
12
,
18
)
var
endDate
=
new
Date
()
console
.
log
(
"
===>test_1100 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1100 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1100 endDate ===>
"
+
endDate
)
console
.
log
(
"
===>test_1100 endDate ===>
"
+
endDate
)
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
...
@@ -320,8 +400,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -320,8 +400,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1100 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_1100 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
var
DoNotDateK
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateK
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
DoNotDateK
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -339,8 +424,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -339,8 +424,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_1200
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_1200
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
22
,
12
,
18
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
12
,
18
)
var
endDate
=
new
Date
()
console
.
log
(
"
===>test_1200 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1200 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1200 endDate ===>
"
+
endDate
)
console
.
log
(
"
===>test_1200 endDate ===>
"
+
endDate
)
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
...
@@ -351,8 +436,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -351,8 +436,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1200 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
));
console
.
log
(
"
===>test_1200 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
var
DoNotDateL
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateL
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
DoNotDateL
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -379,8 +469,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -379,8 +469,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_1300
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_1300
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
23
,
12
,
18
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
2
,
18
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
()
-
2
,
beginDate
.
getHours
()
+
6
,
beginDate
.
getMinutes
()
+
32
)
console
.
log
(
"
===>test_1300 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1300 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1300 endDate ===>
"
+
endDate
)
console
.
log
(
"
===>test_1300 endDate ===>
"
+
endDate
)
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
...
@@ -392,8 +486,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -392,8 +486,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1300 getDoNotDisturbDate success===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_1300 getDoNotDisturbDate success===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 12:18:00 GMT+0000
"
);
var
DoNotDateM
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 02:18:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateM
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -411,8 +510,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -411,8 +510,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_1400
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_1400
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
23
,
12
,
18
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
2
,
18
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
()
-
1
,
beginDate
.
getHours
()
+
6
,
beginDate
.
getMinutes
()
+
32
)
console
.
log
(
"
===>test_1400 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1400 beginDate ===>
"
+
beginDate
)
console
.
log
(
"
===>test_1400 endDate ===>
"
+
endDate
)
console
.
log
(
"
===>test_1400 endDate ===>
"
+
endDate
)
await
notify
.
setDoNotDisturbDate
({
await
notify
.
setDoNotDisturbDate
({
...
@@ -423,8 +526,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -423,8 +526,13 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1400 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_1400 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 12:18:00 GMT+0000
"
);
var
DoNotDateN
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 02:18:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateN
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -523,6 +631,7 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -523,6 +631,7 @@ describe('ActsAnsDoNotDisturbTest', function () {
end
:
endDate
end
:
endDate
})
})
done
();
done
();
})
})
})
/*
/*
...
@@ -593,21 +702,35 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -593,21 +702,35 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate
* @tc.desc: verify the function of setDoNotDisturbDate
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_2100
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_2100
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
9
,
34
)
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
19
,
16
,
12
)
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
11
,
beginDate
.
getMinutes
()
+
26
)
var
subInfo
=
{
var
subInfo
=
{
onConnect
:
connectCallbacka
,
onConnect
:
connectCallbacka
,
onDoNotDisturbDateChange
:
async
(
data
)
=>
{
onDoNotDisturbDateChange
:
async
(
data
)
=>
{
console
.
debug
(
"
==>disturbModeCallbacka data==>
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
==>disturbModeCallbacka data==>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 09:34:00 GMT+0000
"
);
var
DoNotDateO
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateO
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_2100 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
console
.
log
(
"
===>test_2100 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbacka
);
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbacka
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 09:34:00 GMT+0000
"
);
var
DoNotDateP
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateP
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -634,21 +757,35 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -634,21 +757,35 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of displayBadge
* @tc.desc: verify the function of displayBadge
*/
*/
it
(
'
ActsSetDoNotDisturbTest_test_2200
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsSetDoNotDisturbTest_test_2200
'
,
0
,
async
function
(
done
)
{
var
beginDate
=
new
Date
(
2021
,
11
,
19
,
8
,
18
);
var
beginDate
=
new
Date
()
var
endDate
=
new
Date
(
2021
,
11
,
22
,
24
,
46
);
var
endDate
=
new
Date
(
beginDate
.
getFullYear
(),
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
()
+
16
,
beginDate
.
getMinutes
()
+
45
)
var
subInfo
=
{
var
subInfo
=
{
onConnect
:
connectCallbackb
,
onConnect
:
connectCallbackb
,
onDoNotDisturbDateChange
:
async
(
data
)
=>
{
onDoNotDisturbDateChange
:
async
(
data
)
=>
{
console
.
debug
(
"
==>disturbModeCallbackb data==>
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
==>disturbModeCallbackb data==>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
var
DoNotDateQ
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateQ
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
await
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_2200 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
===>test_2200 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
));
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbackb
);
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbackb
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
var
DoNotDateR
=
new
Date
(
beginDate
.
getFullYear
(),
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
beginDate
.
getMonth
(),
beginDate
.
getDate
(),
beginDate
.
getHours
(),
beginDate
.
getMinutes
())
expect
(
data
.
begin
.
toString
()).
assertEqual
(
DoNotDateR
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
endDate
);
await
notify
.
setDoNotDisturbDate
(
await
notify
.
setDoNotDisturbDate
(
{
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
...
@@ -1101,6 +1238,5 @@ describe('ActsAnsDoNotDisturbTest', function () {
...
@@ -1101,6 +1238,5 @@ describe('ActsAnsDoNotDisturbTest', function () {
}),
500
);
}),
500
);
})
})
})
})
})
xts_acts
@
315405d3
Subproject commit 315405d38c533c02ae72ddbbb7ef5c0c2c72395b
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录