提交 eb4f5634 编写于 作者: Z zhaoyuan17

Ans xts failed fix

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 449803ee
...@@ -49,9 +49,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -49,9 +49,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
it('ActsGetDoNotDisturbTest_test_0100', 0, async function (done) { it('ActsGetDoNotDisturbTest_test_0100', 0, async function (done) {
await notify.getDoNotDisturbDate((err,data) => { await notify.getDoNotDisturbDate((err,data) => {
console.log("===>ActsGetDoNotDisturbTest_test_0100 success===>"+JSON.stringify(data)) console.log("===>ActsGetDoNotDisturbTest_test_0100 success===>"+JSON.stringify(data))
expect(data.type).assertEqual(0) expect(data.type).assertEqual(0);
expect(data.begin).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000") 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.end).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000");
done(); done();
}) })
}) })
...@@ -64,9 +64,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -64,9 +64,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
it('ActsGetDoNotDisturbTest_test_0200', 0, async function (done) { it('ActsGetDoNotDisturbTest_test_0200', 0, async function (done) {
notify.getDoNotDisturbDate().then((promise)=>{ notify.getDoNotDisturbDate().then((promise)=>{
console.log("===>test_0200 success===>"+JSON.stringify(promise)) console.log("===>test_0200 success===>"+JSON.stringify(promise))
expect(promise.type).assertEqual(0) expect(promise.type).assertEqual(0);
expect(promise.begin).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000") 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.end).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000");
done()} done()}
).catch((err)=>{ ).catch((err)=>{
console.log("===>ActsGetDoNotDisturbTest_test_0200 err===>"+JSON.stringify(err)) console.log("===>ActsGetDoNotDisturbTest_test_0200 err===>"+JSON.stringify(err))
...@@ -89,9 +89,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -89,9 +89,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===>test_0300 success===>"+err.code) console.log("===>test_0300 success===>"+err.code)
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((err,data)=>{
console.log("===>test_0300 getDoNotDisturbDate===>"+err.code+JSON.stringify(data)) console.log("===>test_0300 getDoNotDisturbDate===>"+err.code+JSON.stringify(data))
expect(data.type).assertEqual(0) expect(data.type).assertEqual(0);
expect(data.begin).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000") 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.end).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000");
done(); done();
}) })
}) })
...@@ -111,10 +111,10 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -111,10 +111,10 @@ describe('ActsAnsDoNotDisturbTest', function () {
end:endDate end:endDate
}).then( }).then(
await notify.getDoNotDisturbDate().then((data)=>{ await notify.getDoNotDisturbDate().then((data)=>{
console.log("===>test_0400 getDoNotDisturbDate===>"+JSON.stringify(data)) console.log("===>test_0400 getDoNotDisturbDate===>"+JSON.stringify(data));
expect(data.type).assertEqual(0) expect(data.type).assertEqual(0);
expect(data.begin).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000") 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.end).assertEqual("Thu Jan 01 1970 00:00:00 GMT+0000");
done(); done();
}) })
) )
...@@ -126,19 +126,19 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -126,19 +126,19 @@ 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(2021,11,19,12,10);
var endDate = new Date(2021,11,22,18,42) var endDate = new Date(2021,11,22,18,42);
await notify.setDoNotDisturbDate({ await notify.setDoNotDisturbDate({
type:notify.DoNotDisturbType.TYPE_ONCE, type:notify.DoNotDisturbType.TYPE_ONCE,
begin:beginDate, begin:beginDate,
end:endDate end:endDate
},async(err) => { },async(err) => {
console.log("===>test_0500 success===>"+err.code) console.log("===>test_0500 success===>"+err.code);
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Thu Jan 01 1970 12:10:00 GMT+0000") 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.end).assertEqual("Thu Jan 01 1970 18:42:00 GMT+0000");
done(); done();
}) })
}) })
...@@ -159,9 +159,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -159,9 +159,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
}).then( }).then(
await notify.getDoNotDisturbDate().then((data)=>{ await notify.getDoNotDisturbDate().then((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).assertEqual("Thu Jan 01 1970 08:13:00 GMT+0000") 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.end).assertEqual("Thu Jan 01 1970 18:42:00 GMT+0000");
done(); done();
}) })
) )
...@@ -183,9 +183,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -183,9 +183,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===>test_0700 success===>"+err.code) console.log("===>test_0700 success===>"+err.code)
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Sun Dec 19 2021 08:18:00 GMT+0000") 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.end).assertEqual("Thu Dec 23 2021 00:46:00 GMT+0000");
done(); done();
}) })
}) })
...@@ -208,9 +208,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -208,9 +208,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
}).then( }).then(
notify.getDoNotDisturbDate().then((data)=>{ notify.getDoNotDisturbDate().then((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).assertEqual("Sat Dec 18 2021 16:12:00 GMT+0000") 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.end).assertEqual("Sun Dec 19 2021 16:12:00 GMT+0000");
done(); done();
}) })
) )
...@@ -232,9 +232,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -232,9 +232,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===>ActsSetDoNotDisturbTest_test_0900 success===>"+err.code) console.log("===>ActsSetDoNotDisturbTest_test_0900 success===>"+err.code)
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Sun Dec 19 2021 12:12:00 GMT+0000") 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.end).assertEqual("Sun Dec 19 2021 16:12:00 GMT+0000");
done(); done();
}) })
}) })
...@@ -257,9 +257,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -257,9 +257,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
}).then( }).then(
await notify.getDoNotDisturbDate().then((data)=>{ await notify.getDoNotDisturbDate().then((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).assertEqual("Sun Dec 19 2021 08:18:00 GMT+0000") 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.end).assertEqual("Thu Dec 23 2021 00:46:00 GMT+0000");
done(); done();
}) })
) )
...@@ -283,9 +283,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -283,9 +283,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===>test_1100 success===>"+err.code) console.log("===>test_1100 success===>"+err.code)
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Wed Dec 22 2021 12:18:00 GMT+0000") 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.end).assertEqual("Wed Dec 22 2021 12:18:00 GMT+0000");
done(); done();
}) })
}) })
...@@ -308,9 +308,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -308,9 +308,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
}).then( }).then(
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Wed Dec 22 2021 12:18:00 GMT+0000") 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.end).assertEqual("Wed Dec 22 2021 12:18:00 GMT+0000");
done(); done();
}) })
).catch((err)=>{ ).catch((err)=>{
...@@ -337,9 +337,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -337,9 +337,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===>test_1300 success===>"+err.code) console.log("===>test_1300 success===>"+err.code)
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Thu Dec 23 2021 12:18:00 GMT+0000") 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.end).assertEqual("Wed Dec 22 2021 02:18:00 GMT+0000");
done(); done();
}) })
}) })
...@@ -362,9 +362,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -362,9 +362,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
}).then( }).then(
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Thu Dec 23 2021 12:18:00 GMT+0000") 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.end).assertEqual("Wed Dec 22 2021 02:18:00 GMT+0000");
done(); done();
}) })
).catch((err)=>{ ).catch((err)=>{
...@@ -379,17 +379,17 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -379,17 +379,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate * @tc.desc: verify the function of setDoNotDisturbDate
*/ */
it('ActsSetDoNotDisturbTest_test_1500', 0, async function (done) { it('ActsSetDoNotDisturbTest_test_1500', 0, async function (done) {
var beginDate = new Date(2021,11,22,12,18) var beginDate = new Date(2021,11,22,12,18);
var endDate = new Date(2021,11,22,12,18) var endDate = new Date(2021,11,22,12,18);
console.log("===>test_1500 beginDate ===>"+beginDate) console.log("===>test_1500 beginDate ===>"+beginDate);
console.log("===>test_1500 endDate ===>"+endDate) console.log("===>test_1500 endDate ===>"+endDate);
await notify.setDoNotDisturbDate({ await notify.setDoNotDisturbDate({
type:notify.DoNotDisturbType.TYPE_CLEARLY, type:notify.DoNotDisturbType.TYPE_CLEARLY,
begin:beginDate, begin:beginDate,
end:endDate end:endDate
},(err) => { },(err) => {
console.log("===>ActsSetDoNotDisturbTest_test_1500 success===>"+err.code) console.log("===>ActsSetDoNotDisturbTest_test_1500 success===>"+err.code);
expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM) expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM);
done(); done();
}) })
}) })
...@@ -400,17 +400,17 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -400,17 +400,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of setDoNotDisturbDate * @tc.desc: verify the function of setDoNotDisturbDate
*/ */
it('ActsSetDoNotDisturbTest_test_1600', 0, async function (done) { it('ActsSetDoNotDisturbTest_test_1600', 0, async function (done) {
var beginDate = new Date(2021,11,22,12,18) var beginDate = new Date(2021,11,22,12,18);
var endDate = new Date(2021,11,22,12,18) var endDate = new Date(2021,11,22,12,18);
console.log("===>test_1600 beginDate ===>"+beginDate) console.log("===>test_1600 beginDate ===>"+beginDate);
console.log("===>test_1600 endDate ===>"+endDate) console.log("===>test_1600 endDate ===>"+endDate);
await notify.setDoNotDisturbDate({ await notify.setDoNotDisturbDate({
type:notify.DoNotDisturbType.TYPE_CLEARLY, type:notify.DoNotDisturbType.TYPE_CLEARLY,
begin:beginDate, begin:beginDate,
end:endDate end:endDate
}).then().catch((err)=>{ }).then().catch((err)=>{
console.log("===>test_1600 fail===>"+JSON.stringify(err)) console.log("===>test_1600 fail===>"+JSON.stringify(err));
expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM) expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM);
done(); done();
}) })
}) })
...@@ -421,17 +421,17 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -421,17 +421,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of displayBadge * @tc.desc: verify the function of displayBadge
*/ */
it('ActsSetDoNotDisturbTest_test_1700', 0, async function (done) { it('ActsSetDoNotDisturbTest_test_1700', 0, async function (done) {
var beginDate = new Date(2021,11,22,20,18) var beginDate = new Date(2021,11,22,20,18);
var endDate = new Date(2021,11,22,2,18) var endDate = new Date(2021,11,22,2,18);
console.log("===>test_1700 beginDate ===>"+beginDate) console.log("===>test_1700 beginDate ===>"+beginDate);
console.log("===>test_1700 endDate ===>"+endDate) console.log("===>test_1700 endDate ===>"+endDate);
notify.setDoNotDisturbDate({ notify.setDoNotDisturbDate({
type:notify.DoNotDisturbType.TYPE_CLEARLY, type:notify.DoNotDisturbType.TYPE_CLEARLY,
begin:beginDate, begin:beginDate,
end:endDate end:endDate
},async(err)=>{ },async(err)=>{
console.log("===>test_1700 setDoNotDisturbDate===>"+JSON.stringify(err)) console.log("===>test_1700 setDoNotDisturbDate===>"+JSON.stringify(err));
expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM) expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM);
done(); done();
}) })
...@@ -441,17 +441,17 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -441,17 +441,17 @@ describe('ActsAnsDoNotDisturbTest', function () {
* @tc.desc: verify the function of displayBadge * @tc.desc: verify the function of displayBadge
*/ */
it('ActsSetDoNotDisturbTest_test_1800', 0, async function (done) { it('ActsSetDoNotDisturbTest_test_1800', 0, async function (done) {
var beginDate = new Date(2021,11,22,20,18) var beginDate = new Date(2021,11,22,20,18);
var endDate = new Date(2021,11,22,2,18) var endDate = new Date(2021,11,22,2,18);
console.log("===>test_1800 beginDate ===>"+beginDate) console.log("===>test_1800 beginDate ===>"+beginDate);
console.log("===>test_1800 endDate ===>"+endDate) console.log("===>test_1800 endDate ===>"+endDate);
notify.setDoNotDisturbDate({ notify.setDoNotDisturbDate({
type:notify.DoNotDisturbType.TYPE_CLEARLY, type:notify.DoNotDisturbType.TYPE_CLEARLY,
begin:beginDate, begin:beginDate,
end:endDate end:endDate
}).then().catch((err)=>{ }).then().catch((err)=>{
console.log("===>test_1800 setDoNotDisturbDate fail===>"+JSON.stringify(err)) console.log("===>test_1800 setDoNotDisturbDate fail===>"+JSON.stringify(err))
expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM) expect(err.code).assertEqual(ERR_ANS_INVALID_PARAM);
done(); done();
}) })
}) })
...@@ -467,9 +467,9 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -467,9 +467,9 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin:100, begin:100,
end:100 end:100
},async(err) => { },async(err) => {
console.log("===>test_1900 success===>"+err.code) console.log("===>test_1900 success===>"+err.code);
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((err,data)=>{
console.log("===>test_1900 getDoNotDisturbDate success===>"+err.code+JSON.stringify(data)) console.log("===>test_1900 getDoNotDisturbDate success===>"+err.code+JSON.stringify(data));
}) })
}) })
done(); done();
...@@ -486,8 +486,8 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -486,8 +486,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin:100, begin:100,
end:100 end:100
}) })
console.log("===>ActsSetDoNotDisturbTest_test_2000 promise===>"+promise) console.log("===>ActsSetDoNotDisturbTest_test_2000 promise===>"+promise);
expect(promise).assertEqual(undefined) expect(promise).assertEqual(undefined);
done(); done();
}) })
...@@ -503,15 +503,15 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -503,15 +503,15 @@ describe('ActsAnsDoNotDisturbTest', function () {
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).assertEqual("Sun Dec 19 2021 09:34:00 GMT+0000") 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.end).assertEqual("Sun Dec 19 2021 16:12:00 GMT+0000");
await notify.getDoNotDisturbDate((err,data)=>{ await notify.getDoNotDisturbDate((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).assertEqual("Sun Dec 19 2021 09:34:00 GMT+0000") 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.end).assertEqual("Sun Dec 19 2021 16:12:00 GMT+0000");
done(); done();
}) })
}, },
...@@ -522,7 +522,7 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -522,7 +522,7 @@ describe('ActsAnsDoNotDisturbTest', function () {
begin:beginDate, begin:beginDate,
end:endDate end:endDate
},async (err) => { },async (err) => {
console.log("===>test_2100 success===>"+err.code) console.log("===>test_2100 success===>"+err.code);
}) })
}) })
...@@ -532,21 +532,21 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -532,21 +532,21 @@ 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(2021,11,19,8,18);
var endDate = new Date(2021,11,22,24,46) var endDate = new Date(2021,11,22,24,46);
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).assertEqual("Sun Dec 19 2021 08:18:00 GMT+0000") 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.end).assertEqual("Thu Dec 23 2021 00:46:00 GMT+0000");
await notify.getDoNotDisturbDate().then((data)=>{ await notify.getDoNotDisturbDate().then((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).assertEqual("Sun Dec 19 2021 08:18:00 GMT+0000") 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.end).assertEqual("Thu Dec 23 2021 00:46:00 GMT+0000");
done(); done();
}) })
}, },
...@@ -568,8 +568,8 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -568,8 +568,8 @@ describe('ActsAnsDoNotDisturbTest', function () {
*/ */
it('ActsGetDoNotDisturbTest_test_2300', 0, async function (done) { it('ActsGetDoNotDisturbTest_test_2300', 0, async function (done) {
await notify.supportDoNotDisturbMode((err,data) => { await notify.supportDoNotDisturbMode((err,data) => {
console.log("===>test_2300 success===>"+JSON.stringify(err)+data) console.log("===>test_2300 success===>"+JSON.stringify(err)+data);
expect(data).assertEqual(true) expect(data).assertEqual(true);
done(); done();
}) })
}) })
...@@ -581,11 +581,11 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -581,11 +581,11 @@ describe('ActsAnsDoNotDisturbTest', function () {
*/ */
it('ActsGetDoNotDisturbTest_test_2400', 0, async function (done) { it('ActsGetDoNotDisturbTest_test_2400', 0, async function (done) {
notify.supportDoNotDisturbMode().then((promise)=>{ notify.supportDoNotDisturbMode().then((promise)=>{
console.log("===>ActsGetDoNotDisturbTest_test_2400 success===>"+promise) console.log("===>ActsGetDoNotDisturbTest_test_2400 success===>"+promise);
expect(promise).assertEqual(true) expect(promise).assertEqual(true);
done()} done()}
).catch((err)=>{ ).catch((err)=>{
console.log("===>test_2400 err===>"+err.code) console.log("===>test_2400 err===>"+err.code);
}) })
}) })
...@@ -602,7 +602,7 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -602,7 +602,7 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===test_2500 onConsume===>"+JSON.stringify(data)); console.log("===test_2500 onConsume===>"+JSON.stringify(data));
expect(data.sound).assertEqual("normalSocialMusic"); expect(data.sound).assertEqual("normalSocialMusic");
console.log("===test_2500 onConsume sound===>"+data.sound); console.log("===test_2500 onConsume sound===>"+data.sound);
expect(data.vibrationValues).assertEqual("1,0,1,0,1,0"); expect(JSON.stringify(data.vibrationValues)).assertEqual(JSON.stringify([1,0,1,0,1,0]));
console.log("===test_2500 onConsume vibrationValues===>"+data.vibrationValues); console.log("===test_2500 onConsume vibrationValues===>"+data.vibrationValues);
} }
function publishCallback(err){ function publishCallback(err){
...@@ -692,7 +692,7 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -692,7 +692,7 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===test_2600 onConsume===>"+JSON.stringify(data)); console.log("===test_2600 onConsume===>"+JSON.stringify(data));
expect(data.sound).assertEqual("normalSocialMusic"); expect(data.sound).assertEqual("normalSocialMusic");
console.log("===test_2600 onConsume sound===>"+data.sound); console.log("===test_2600 onConsume sound===>"+data.sound);
expect(data.vibrationValues).assertEqual("1,0,1,0,1,0"); expect(JSON.stringify(data.vibrationValues)).assertEqual(JSON.stringify([1,0,1,0,1,0]));
console.log("===test_2600 onConsume vibrationValues===>"+data.vibrationValues); console.log("===test_2600 onConsume vibrationValues===>"+data.vibrationValues);
} }
...@@ -779,7 +779,7 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -779,7 +779,7 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===test_2700 onConsume===>"+JSON.stringify(data)); console.log("===test_2700 onConsume===>"+JSON.stringify(data));
expect(data.sound).assertEqual("normalSocialMusic"); expect(data.sound).assertEqual("normalSocialMusic");
console.log("===test_2700 onConsume sound===>"+data.sound); console.log("===test_2700 onConsume sound===>"+data.sound);
expect(data.vibrationValues).assertEqual("1,0,1,0,1,0"); expect(JSON.stringify(data.vibrationValues)).assertEqual(JSON.stringify([1,0,1,0,1,0]));
console.log("===test_2700 onConsume vibrationValues===>"+data.vibrationValues); console.log("===test_2700 onConsume vibrationValues===>"+data.vibrationValues);
} }
...@@ -866,7 +866,7 @@ describe('ActsAnsDoNotDisturbTest', function () { ...@@ -866,7 +866,7 @@ describe('ActsAnsDoNotDisturbTest', function () {
console.log("===test_2800 onConsume===>"+JSON.stringify(data)); console.log("===test_2800 onConsume===>"+JSON.stringify(data));
expect(data.sound).assertEqual("normalSocialMusic"); expect(data.sound).assertEqual("normalSocialMusic");
console.log("===test_2800 onConsume sound===>"+data.sound); console.log("===test_2800 onConsume sound===>"+data.sound);
expect(data.vibrationValues).assertEqual("1,0,1,0,1,0"); expect(JSON.stringify(data.vibrationValues)).assertEqual(JSON.stringify([1,0,1,0,1,0]));
console.log("===test_2800 onConsume vibrationValues===>"+data.vibrationValues); console.log("===test_2800 onConsume vibrationValues===>"+data.vibrationValues);
} }
......
...@@ -1003,9 +1003,8 @@ describe('ActsAnsActiveTest', function () { ...@@ -1003,9 +1003,8 @@ describe('ActsAnsActiveTest', function () {
function getAllCallbackNine(err,data){ function getAllCallbackNine(err,data){
console.debug("===========Ans_GetAllActive_0900 getAllCallbackNine data.length============>"+data.length); console.debug("===========Ans_GetAllActive_0900 getAllCallbackNine data.length============>"+data.length);
console.debug("===========Ans_GetAllActive_0900 getAllCallbackNine err.code============>"+err.code); console.debug("===========Ans_GetAllActive_0900 getAllCallbackNine err.code============>"+err.code);
expect(err.code).assertEqual(ERR_ANS_NON_SYSTEM_APP); expect(err.code != 0).assertEqual(true);
} }
/* /*
* @tc.number: Ans_GetAllActive_0900 * @tc.number: Ans_GetAllActive_0900
* @tc.name: getAllActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; * @tc.name: getAllActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void;
...@@ -1063,7 +1062,7 @@ describe('ActsAnsActiveTest', function () { ...@@ -1063,7 +1062,7 @@ describe('ActsAnsActiveTest', function () {
await notify.getAllActiveNotifications().then(()=>{ await notify.getAllActiveNotifications().then(()=>{
console.debug("=======Ans_GetAllActive_1000 then========>"); console.debug("=======Ans_GetAllActive_1000 then========>");
}).catch((err)=>{ }).catch((err)=>{
expect(err.code).assertEqual(ERR_ANS_NON_SYSTEM_APP); expect(err.code != 0).assertEqual(true);
console.debug("=======Ans_GetAllActive_1000 err==========>"+err.code); console.debug("=======Ans_GetAllActive_1000 err==========>"+err.code);
}); });
setTimeout(function(){ setTimeout(function(){
......
...@@ -35,7 +35,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -35,7 +35,7 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteOne, onConnect:onConnecteOne,
onDisconnect:onDisconnectOne onDisconnect:onDisconnectOne
} }
notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0100 subscribe=============>"); console.info("===========Ans_UnSubscriber_0100 subscribe=============>");
notify.unsubscribe(subscriber, (err)=>{ notify.unsubscribe(subscriber, (err)=>{
console.debug("===========Ans_UnSubscriber_0100 unsubscribe err.code=================>"+err.code); console.debug("===========Ans_UnSubscriber_0100 unsubscribe err.code=================>"+err.code);
...@@ -65,7 +65,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -65,7 +65,7 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteTwo, onConnect:onConnecteTwo,
onDisconnect:onDisconnectTwo onDisconnect:onDisconnectTwo
} }
notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0200 subscribe=============>"); console.info("===========Ans_UnSubscriber_0200 subscribe=============>");
notify.unsubscribe(subscriber).then(()=>{ notify.unsubscribe(subscriber).then(()=>{
console.debug("=======Ans_UnSubscriber_0200 subscribe then==========>"); console.debug("=======Ans_UnSubscriber_0200 subscribe then==========>");
...@@ -179,7 +179,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -179,7 +179,7 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteTest, onConnect:onConnecteTest,
onDisconnect:onDisconnectTest onDisconnect:onDisconnectTest
} }
notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0500 subscribe=============>"); console.info("===========Ans_UnSubscriber_0500 subscribe=============>");
notify.unsubscribe(subscriberTest,(err)=>{ notify.unsubscribe(subscriberTest,(err)=>{
console.debug("Ans_UnSubscriber_0500 unsubscribe err.code=================>"+err.code); console.debug("Ans_UnSubscriber_0500 unsubscribe err.code=================>"+err.code);
...@@ -223,7 +223,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -223,7 +223,7 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteTestTwo, onConnect:onConnecteTestTwo,
onDisconnect:onDisconnectTestTwo onDisconnect:onDisconnectTestTwo
} }
notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0600 subscribe=============>"); console.info("===========Ans_UnSubscriber_0600 subscribe=============>");
notify.unsubscribe(subscriberTest).then().catch((err)=>{ notify.unsubscribe(subscriberTest).then().catch((err)=>{
console.debug("=======Ans_UnSubscriber_0600 unsubscribe catch err=================>"+err.code); console.debug("=======Ans_UnSubscriber_0600 unsubscribe catch err=================>"+err.code);
...@@ -259,7 +259,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -259,7 +259,7 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteSeven, onConnect:onConnecteSeven,
onDisconnect:onDisconnectSeven onDisconnect:onDisconnectSeven
} }
notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0700 subscribe=============>"); console.info("===========Ans_UnSubscriber_0700 subscribe=============>");
notify.unsubscribe(subscriber, (err)=>{ notify.unsubscribe(subscriber, (err)=>{
console.debug("Ans_UnSubscriber_0700 unsubscribe first err.code=================>"+err.code); console.debug("Ans_UnSubscriber_0700 unsubscribe first err.code=================>"+err.code);
...@@ -299,7 +299,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -299,7 +299,7 @@ describe('ActsAnsUnSubscriberTest', function () {
onConnect:onConnecteEight, onConnect:onConnecteEight,
onDisconnect:onDisconnectEight onDisconnect:onDisconnectEight
} }
notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info("===========Ans_UnSubscriber_0800 subscribe=============>"); console.info("===========Ans_UnSubscriber_0800 subscribe=============>");
notify.unsubscribe(subscriber).then((err)=>{ notify.unsubscribe(subscriber).then((err)=>{
console.debug("=======Ans_UnSubscriber_0800 subscribe first then err=================>"+err.code); console.debug("=======Ans_UnSubscriber_0800 subscribe first then err=================>"+err.code);
...@@ -394,7 +394,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -394,7 +394,7 @@ describe('ActsAnsUnSubscriberTest', function () {
*/ */
it('Ans_UnSubscriber_1100', 0, async function (done) { it('Ans_UnSubscriber_1100', 0, async function (done) {
console.info("===========Ans_UnSubscriber_1100 start=============>"); console.info("===========Ans_UnSubscriber_1100 start=============>");
notify.subscribe({ await notify.subscribe({
onConnect:onConnecteEleven, onConnect:onConnecteEleven,
onDisconnect:onDisconnectEleven onDisconnect:onDisconnectEleven
}); });
...@@ -429,7 +429,7 @@ describe('ActsAnsUnSubscriberTest', function () { ...@@ -429,7 +429,7 @@ describe('ActsAnsUnSubscriberTest', function () {
*/ */
it('Ans_UnSubscriber_1200', 0, async function (done) { it('Ans_UnSubscriber_1200', 0, async function (done) {
console.info("===========Ans_UnSubscriber_1200 start=============>"); console.info("===========Ans_UnSubscriber_1200 start=============>");
notify.subscribe({ await notify.subscribe({
onConnect:onConnecteTwelve, onConnect:onConnecteTwelve,
onDisconnect:onConnecteTwelve onDisconnect:onConnecteTwelve
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册