Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
97564d39
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看板
提交
97564d39
编写于
12月 22, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 22, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1404 Fix ans test failed case
Merge pull request !1404 from blackleon/master_ans_1221
上级
8280c55a
294cc414
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
235 addition
and
78 deletion
+235
-78
notification/ans_standard/publish_test/donotdisturbmode/entry/src/main/js/test/doNotDisturbTest.js
...notdisturbmode/entry/src/main/js/test/doNotDisturbTest.js
+235
-78
未找到文件。
notification/ans_standard/publish_test/donotdisturbmode/entry/src/main/js/test/doNotDisturbTest.js
浏览文件 @
97564d39
...
...
@@ -50,8 +50,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
console
.
log
(
"
===>ActsGetDoNotDisturbTest_test_0100 success===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
0
);
expect
(
data
.
begin
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
done
();
})
})
...
...
@@ -65,8 +65,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
notify
.
getDoNotDisturbDate
().
then
((
promise
)
=>
{
console
.
log
(
"
===>test_0200 success===>
"
+
JSON
.
stringify
(
promise
))
expect
(
promise
.
type
).
assertEqual
(
0
);
expect
(
promise
.
begin
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
promise
.
end
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
promise
.
begin
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
promise
.
end
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
done
()}
).
catch
((
err
)
=>
{
console
.
log
(
"
===>ActsGetDoNotDisturbTest_test_0200 err===>
"
+
JSON
.
stringify
(
err
))
...
...
@@ -90,8 +90,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
console
.
log
(
"
===>test_0300 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
0
);
expect
(
data
.
begin
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
done
();
})
})
...
...
@@ -113,8 +113,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
await
notify
.
getDoNotDisturbDate
().
then
((
data
)
=>
{
console
.
log
(
"
===>test_0400 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
0
);
expect
(
data
.
begin
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()
).
assertEqual
(
"
Thu Jan 01 1970 00:00:00 GMT+0000
"
);
done
();
})
)
...
...
@@ -134,11 +134,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
end
:
endDate
},
async
(
err
)
=>
{
console
.
log
(
"
===>test_0500 success===>
"
+
err
.
code
);
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_0500 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
1
);
expect
(
data
.
begin
).
assertEqual
(
"
Thu Jan 01 1970 12:10:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Jan 01 1970 18:42:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 12:10:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 18:42:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -157,11 +163,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin
:
beginDate
,
end
:
endDate
}).
then
(
await
notify
.
getDoNotDisturbDate
().
then
((
data
)
=>
{
await
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_0600 success===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
1
);
expect
(
data
.
begin
).
assertEqual
(
"
Thu Jan 01 1970 08:13:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Jan 01 1970 18:42:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 08:13:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Jan 01 1970 18:42:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
)
...
...
@@ -181,11 +193,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
end
:
endDate
},
async
(
err
)
=>
{
console
.
log
(
"
===>test_0700 success===>
"
+
err
.
code
)
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_0700 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -206,11 +224,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin
:
beginDate
,
end
:
endDate
}).
then
(
notify
.
getDoNotDisturbDate
().
then
((
data
)
=>
{
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_0800 success===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
).
assertEqual
(
"
Sat Dec 18 2021 16:12:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sat Dec 18 2021 16:12:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
)
...
...
@@ -230,11 +254,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
end
:
endDate
},
async
(
err
)
=>
{
console
.
log
(
"
===>ActsSetDoNotDisturbTest_test_0900 success===>
"
+
err
.
code
)
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_0900 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
).
assertEqual
(
"
Sun Dec 19 2021 12:12:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 12:12:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -255,11 +285,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin
:
beginDate
,
end
:
endDate
}).
then
(
await
notify
.
getDoNotDisturbDate
().
then
((
data
)
=>
{
await
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_1000 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
)
...
...
@@ -281,11 +317,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
end
:
endDate
},
async
(
err
)
=>
{
console
.
log
(
"
===>test_1100 success===>
"
+
err
.
code
)
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1100 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -306,15 +348,27 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin
:
beginDate
,
end
:
endDate
}).
then
(
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
console
.
log
(
"
===>test_1200 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1200 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
;
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 12:18:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
).
catch
((
err
)
=>
{
).
catch
(
async
(
err
)
=>
{
console
.
log
(
"
===>test_1200 getDoNotDisturbDate fail===>
"
+
JSON
.
stringify
(
err
))
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -335,11 +389,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
end
:
endDate
},
async
(
err
)
=>
{
console
.
log
(
"
===>test_1300 success===>
"
+
err
.
code
)
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1300 getDoNotDisturbDate success===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
).
assertEqual
(
"
Thu Dec 23 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Wed Dec 22 2021 02:18:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 02:18:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -360,15 +420,27 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin
:
beginDate
,
end
:
endDate
}).
then
(
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_1400 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
expect
(
data
.
type
).
assertEqual
(
2
);
expect
(
data
.
begin
).
assertEqual
(
"
Thu Dec 23 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Wed Dec 22 2021 02:18:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 12:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Wed Dec 22 2021 02:18:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
).
catch
((
err
)
=>
{
).
catch
(
async
(
err
)
=>
{
console
.
log
(
"
===>test_1400 getDoNotDisturbDate fail===>
"
+
JSON
.
stringify
(
err
))
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -387,9 +459,15 @@ describe('ActsAnsDoNotDisturbTest', function () {
type
:
notify
.
DoNotDisturbType
.
TYPE_CLEARLY
,
begin
:
beginDate
,
end
:
endDate
},(
err
)
=>
{
},
async
(
err
)
=>
{
console
.
log
(
"
===>ActsSetDoNotDisturbTest_test_1500 success===>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
ERR_ANS_INVALID_PARAM
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -408,9 +486,15 @@ describe('ActsAnsDoNotDisturbTest', function () {
type
:
notify
.
DoNotDisturbType
.
TYPE_CLEARLY
,
begin
:
beginDate
,
end
:
endDate
}).
then
().
catch
((
err
)
=>
{
}).
then
().
catch
(
async
(
err
)
=>
{
console
.
log
(
"
===>test_1600 fail===>
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_ANS_INVALID_PARAM
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -432,6 +516,12 @@ describe('ActsAnsDoNotDisturbTest', function () {
},
async
(
err
)
=>
{
console
.
log
(
"
===>test_1700 setDoNotDisturbDate===>
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_ANS_INVALID_PARAM
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
...
...
@@ -449,9 +539,15 @@ describe('ActsAnsDoNotDisturbTest', function () {
type
:
notify
.
DoNotDisturbType
.
TYPE_CLEARLY
,
begin
:
beginDate
,
end
:
endDate
}).
then
().
catch
((
err
)
=>
{
}).
then
().
catch
(
async
(
err
)
=>
{
console
.
log
(
"
===>test_1800 setDoNotDisturbDate fail===>
"
+
JSON
.
stringify
(
err
))
expect
(
err
.
code
).
assertEqual
(
ERR_ANS_INVALID_PARAM
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
})
...
...
@@ -504,14 +600,20 @@ describe('ActsAnsDoNotDisturbTest', function () {
onDoNotDisturbDateChange
:
async
(
data
)
=>
{
console
.
debug
(
"
==>disturbModeCallbacka data==>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
).
assertEqual
(
"
Sun Dec 19 2021 09:34:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
await
notify
.
getDoNotDisturbDate
((
err
,
data
)
=>
{
expect
(
data
.
begin
.
toString
()
).
assertEqual
(
"
Sun Dec 19 2021 09:34:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()
).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
await
notify
.
getDoNotDisturbDate
(
async
(
err
,
data
)
=>
{
console
.
log
(
"
===>test_2100 getDoNotDisturbDate===>
"
+
err
.
code
+
JSON
.
stringify
(
data
))
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbacka
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
).
assertEqual
(
"
Sun Dec 19 2021 09:34:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 09:34:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 16:12:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
},
...
...
@@ -539,14 +641,20 @@ describe('ActsAnsDoNotDisturbTest', function () {
onDoNotDisturbDateChange
:
async
(
data
)
=>
{
console
.
debug
(
"
==>disturbModeCallbackb data==>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
await
notify
.
getDoNotDisturbDate
().
then
((
data
)
=>
{
expect
(
data
.
begin
.
toString
()
).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()
).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
await
notify
.
getDoNotDisturbDate
().
then
(
async
(
data
)
=>
{
console
.
log
(
"
===>test_2200 getDoNotDisturbDate===>
"
+
JSON
.
stringify
(
data
));
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbackb
);
expect
(
data
.
type
).
assertEqual
(
3
);
expect
(
data
.
begin
).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
expect
(
data
.
begin
.
toString
()).
assertEqual
(
"
Sun Dec 19 2021 08:18:00 GMT+0000
"
);
expect
(
data
.
end
.
toString
()).
assertEqual
(
"
Thu Dec 23 2021 00:46:00 GMT+0000
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
})
},
...
...
@@ -600,10 +708,14 @@ describe('ActsAnsDoNotDisturbTest', function () {
function
onConsume
(
data
){
console
.
log
(
"
===test_2500 onConsume===>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
sound
).
assertEqual
(
"
normalSocialMusic
"
);
console
.
log
(
"
===test_2500 onConsume sound===>
"
+
data
.
sound
);
expect
(
JSON
.
stringify
(
data
.
vibrationValues
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2500 onConsume vibrationValues===>
"
+
data
.
vibrationValues
);
var
hashCode
=
data
.
request
.
hashCode
var
sound
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
sound
console
.
log
(
"
===test_2500 onConsume sound===>
"
+
sound
);
expect
(
sound
).
assertEqual
(
"
normalSocialMusic
"
);
var
vibra
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
vibrationValues
console
.
log
(
"
===test_2500 onConsume vibra===>
"
+
vibra
);
expect
(
JSON
.
stringify
(
vibra
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2500 onConsume end===>
"
);
}
function
publishCallback
(
err
){
console
.
log
(
"
===publishCallback===>
"
+
JSON
.
stringify
(
err
));
...
...
@@ -677,10 +789,19 @@ describe('ActsAnsDoNotDisturbTest', function () {
},
publishCallback
);
setTimeout
((
async
function
(){
console
.
info
(
"
===test_2500 setTimeout===>
"
);
notify
.
unsubscribe
(
subscriber
);
await
notify
.
unsubscribe
(
subscriber
);
console
.
info
(
"
===test_2500 setTimeout unsubscribe===>
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
});
console
.
info
(
"
====test_2500 setDoNotDisturbDate removeSlot============>
"
);
await
notify
.
removeSlot
(
notify
.
SlotType
.
SOCIAL_COMMUNICATION
);
console
.
info
(
"
====test_2500 setTimeout removeSlot============>
"
);
done
();
}),
3
00
);
}),
5
00
);
})
function
onDoNotDisturbDateChange2600
(
mode
){
...
...
@@ -690,10 +811,14 @@ describe('ActsAnsDoNotDisturbTest', function () {
function
onConsume2600
(
data
){
console
.
log
(
"
===test_2600 onConsume===>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
sound
).
assertEqual
(
"
normalSocialMusic
"
);
console
.
log
(
"
===test_2600 onConsume sound===>
"
+
data
.
sound
);
expect
(
JSON
.
stringify
(
data
.
vibrationValues
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2600 onConsume vibrationValues===>
"
+
data
.
vibrationValues
);
var
hashCode
=
data
.
request
.
hashCode
var
sound
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
sound
console
.
log
(
"
===test_2600 onConsume sound===>
"
+
sound
);
expect
(
sound
).
assertEqual
(
"
normalSocialMusic
"
);
var
vibra
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
vibrationValues
console
.
log
(
"
===test_2600 onConsume vibra===>
"
+
vibra
);
expect
(
JSON
.
stringify
(
vibra
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2600 onConsume end===>
"
);
}
/*
...
...
@@ -764,10 +889,19 @@ describe('ActsAnsDoNotDisturbTest', function () {
},
publishCallback
);
setTimeout
((
async
function
(){
console
.
info
(
"
====test_2600 setTimeout====>
"
);
notify
.
unsubscribe
(
subscriber
);
await
notify
.
unsubscribe
(
subscriber
);
console
.
info
(
"
====test_2600 setTimeout unsubscribe====>
"
);
await
notify
.
removeSlot
(
notify
.
SlotType
.
SOCIAL_COMMUNICATION
);
console
.
info
(
"
====test_2600 setTimeout removeSlot============>
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
console
.
info
(
"
====test_2600 setTimeout setDoNotDisturbDate============>
"
);
done
();
}),
3
00
);
}),
5
00
);
})
function
onDoNotDisturbDateChange2700
(
mode
){
...
...
@@ -777,10 +911,14 @@ describe('ActsAnsDoNotDisturbTest', function () {
function
onConsume2700
(
data
){
console
.
log
(
"
===test_2700 onConsume===>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
sound
).
assertEqual
(
"
normalSocialMusic
"
);
console
.
log
(
"
===test_2700 onConsume sound===>
"
+
data
.
sound
);
expect
(
JSON
.
stringify
(
data
.
vibrationValues
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2700 onConsume vibrationValues===>
"
+
data
.
vibrationValues
);
var
hashCode
=
data
.
request
.
hashCode
var
sound
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
sound
console
.
log
(
"
===test_2700 onConsume sound===>
"
+
sound
);
expect
(
sound
).
assertEqual
(
"
normalSocialMusic
"
);
var
vibra
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
vibrationValues
console
.
log
(
"
===test_2700 onConsume vibra===>
"
+
vibra
);
expect
(
JSON
.
stringify
(
vibra
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2700 onConsume end===>
"
);
}
/*
...
...
@@ -851,10 +989,18 @@ describe('ActsAnsDoNotDisturbTest', function () {
},
publishCallback
);
setTimeout
((
async
function
(){
console
.
info
(
"
====test_2700 setTimeout====>
"
);
notify
.
unsubscribe
(
subscriber
);
await
notify
.
unsubscribe
(
subscriber
);
console
.
info
(
"
====test_2700 setTimeout unsubscribe============>
"
);
await
notify
.
removeSlot
(
notify
.
SlotType
.
SOCIAL_COMMUNICATION
);
console
.
info
(
"
====test_2700 setTimeout removeSlot============>
"
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
}),
3
00
);
}),
5
00
);
})
function
onDoNotDisturbDateChange2800
(
mode
){
...
...
@@ -864,10 +1010,14 @@ describe('ActsAnsDoNotDisturbTest', function () {
function
onConsume2800
(
data
){
console
.
log
(
"
===test_2800 onConsume===>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
sound
).
assertEqual
(
"
normalSocialMusic
"
);
console
.
log
(
"
===test_2800 onConsume sound===>
"
+
data
.
sound
);
expect
(
JSON
.
stringify
(
data
.
vibrationValues
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2800 onConsume vibrationValues===>
"
+
data
.
vibrationValues
);
var
hashCode
=
data
.
request
.
hashCode
var
sound
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
sound
console
.
log
(
"
===test_2800 onConsume sound===>
"
+
sound
);
expect
(
sound
).
assertEqual
(
"
normalSocialMusic
"
);
var
vibra
=
data
.
sortingMap
.
sortings
[
hashCode
].
slot
.
vibrationValues
console
.
log
(
"
===test_2800 onConsume vibra===>
"
+
vibra
);
expect
(
JSON
.
stringify
(
vibra
)).
assertEqual
(
JSON
.
stringify
([
1
,
0
,
1
,
0
,
1
,
0
]));
console
.
log
(
"
===test_2800 onConsume end===>
"
);
}
/*
...
...
@@ -938,10 +1088,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
},
publishCallback
);
setTimeout
((
async
function
(){
console
.
info
(
"
======test_2800 setTimeout============>
"
);
notify
.
unsubscribe
(
subscriber
);
await
notify
.
unsubscribe
(
subscriber
);
console
.
info
(
"
======test_2800 setTimeout unsubscribe============>
"
);
await
notify
.
removeSlot
(
notify
.
SlotType
.
SOCIAL_COMMUNICATION
);
await
notify
.
setDoNotDisturbDate
(
{
type
:
notify
.
DoNotDisturbType
.
TYPE_NONE
,
begin
:
beginDate
,
end
:
endDate
})
done
();
}),
3
00
);
}),
5
00
);
})
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录