未验证 提交 f047c473 编写于 作者: O openharmony_ci 提交者: Gitee

!4184 【XTS】【事件通知子系统】 ActsAnsNotificationCancelTest用例补齐

Merge pull request !4184 from 郅建文/master
...@@ -2025,7 +2025,7 @@ describe('ActsAnsNotificationCancel', function () { ...@@ -2025,7 +2025,7 @@ describe('ActsAnsNotificationCancel', function () {
/* /*
* @tc.number: ANS_Cancel_2700 * @tc.number: ANS_Cancel_2700
* @tc.name: cancel(id: number, label?: string): Promise<void> * @tc.name: cancel(id: number, label?: string): Promise<void>
* @tc.desc: add * @tc.desc: add NotificationTemplate extraInfo template badgeNumber
*/ */
it('ANS_Cancel_2700', 0, async function (done) { it('ANS_Cancel_2700', 0, async function (done) {
console.info('===============ANS_Cancel_2700 start==========================>'); console.info('===============ANS_Cancel_2700 start==========================>');
...@@ -2035,6 +2035,10 @@ describe('ActsAnsNotificationCancel', function () { ...@@ -2035,6 +2035,10 @@ describe('ActsAnsNotificationCancel', function () {
} }
await notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info('===============ANS_Cancel_2700 subscribe promise==================>'); console.info('===============ANS_Cancel_2700 subscribe promise==================>');
let NotificationTemplate = {
name:'/system/etc/notification_template/assets/js/downloadTemplate.js',
data:{key3:"789",key4:"111"}
}
let notificationRequest = { let notificationRequest = {
content:{ content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
...@@ -2048,10 +2052,7 @@ describe('ActsAnsNotificationCancel', function () { ...@@ -2048,10 +2052,7 @@ describe('ActsAnsNotificationCancel', function () {
key1: "1231", key1: "1231",
key2:"456" key2:"456"
}, },
template:{ template:NotificationTemplate,
name:'/system/etc/notification_template/assets/js/downloadTemplate.js',
data:{key3:"789",key4:"111"}
},
badgeNumber:1, badgeNumber:1,
} }
await notify.publish(notificationRequest); await notify.publish(notificationRequest);
...@@ -2062,4 +2063,47 @@ describe('ActsAnsNotificationCancel', function () { ...@@ -2062,4 +2063,47 @@ describe('ActsAnsNotificationCancel', function () {
done(); done();
}),timeout); }),timeout);
}) })
/*
* @tc.number: ANS_Cancel_2800
* @tc.name: cancel(id: number, label?: string): Promise<void>
* @tc.desc: add creatorPid
*/
it('ANS_Cancel_2800', 0, async function (done) {
console.info('===============ANS_Cancel_2800 start==========================>');
let subscriber ={
onConsume:onConsumeCancelWrongLabelWrongIdPromise,
onCancel:onCancelCancelWrongLabelWrongIdPromise,
}
await notify.subscribe(subscriber);
console.info('===============ANS_Cancel_2800 subscribe promise==================>');
let NotificationTemplate = {
name:'/system/etc/notification_template/assets/js/downloadTemplate.js',
data:{key3:"789",key4:"111"}
}
let notificationRequest = {
content:{
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: 'test_title',
text: 'test_text',
additionalText: 'test_additionalText'
},
},
extraInfo:{
key1: "1231",
key2:"456"
},
template:NotificationTemplate,
creatorPid:1,
}
await notify.publish(notificationRequest);
console.info('===============ANS_Cancel_2800 publish promise==================>');
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info('======ANS_Cancel_2800 setTimeout unsubscribe end==================>');
done();
}),timeout);
})
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册