提交 d061350f 编写于 作者: Z zhijianwen

cancel

Signed-off-by: Nzhijianwen <zhijianwen@huawei.com>
上级 3c2923eb
...@@ -2022,44 +2022,88 @@ describe('ActsAnsNotificationCancel', function () { ...@@ -2022,44 +2022,88 @@ describe('ActsAnsNotificationCancel', function () {
}),timeout); }),timeout);
}) })
/*
* @tc.number: ANS_Cancel_2700
* @tc.name: cancel(id: number, label?: string): Promise<void>
* @tc.desc: add NotificationTemplate extraInfo template badgeNumber
*/
it('ANS_Cancel_2700', 0, async function (done) {
console.info('===============ANS_Cancel_2700 start==========================>');
let subscriber ={
onConsume:onConsumeCancelWrongLabelWrongIdPromise,
onCancel:onCancelCancelWrongLabelWrongIdPromise,
}
await notify.subscribe(subscriber);
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 = {
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,
badgeNumber:1,
}
await notify.publish(notificationRequest);
console.info('===============ANS_Cancel_2700 publish promise==================>');
setTimeout((async function(){
await notify.unsubscribe(subscriber);
console.info('======ANS_Cancel_2700 setTimeout unsubscribe end==================>');
done();
}),timeout);
})
/* /*
* @tc.number: ANS_Cancel_2700 * @tc.number: ANS_Cancel_2800
* @tc.name: cancel(id: number, label?: string): Promise<void> * @tc.name: cancel(id: number, label?: string): Promise<void>
* @tc.desc: add * @tc.desc: add creatorPid
*/ */
it('ANS_Cancel_2700', 0, async function (done) { it('ANS_Cancel_2800', 0, async function (done) {
console.info('===============ANS_Cancel_2700 start==========================>'); console.info('===============ANS_Cancel_2800 start==========================>');
let subscriber ={ let subscriber ={
onConsume:onConsumeCancelWrongLabelWrongIdPromise, onConsume:onConsumeCancelWrongLabelWrongIdPromise,
onCancel:onCancelCancelWrongLabelWrongIdPromise, onCancel:onCancelCancelWrongLabelWrongIdPromise,
} }
await notify.subscribe(subscriber); await notify.subscribe(subscriber);
console.info('===============ANS_Cancel_2700 subscribe promise==================>'); console.info('===============ANS_Cancel_2800 subscribe promise==================>');
let notificationRequest = {
content:{ let NotificationTemplate = {
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, name:'/system/etc/notification_template/assets/js/downloadTemplate.js',
normal: { data:{key3:"789",key4:"111"}
title: 'test_title', }
text: 'test_text', let notificationRequest = {
additionalText: 'test_additionalText' content:{
}, contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
}, normal: {
extraInfo:{ title: 'test_title',
key1: "1231", text: 'test_text',
key2:"456" additionalText: 'test_additionalText'
}, },
template:{ },
name:'/system/etc/notification_template/assets/js/downloadTemplate.js', extraInfo:{
data:{key3:"789",key4:"111"} key1: "1231",
}, key2:"456"
badgeNumber:1, },
} template:NotificationTemplate,
await notify.publish(notificationRequest); creatorPid:1,
console.info('===============ANS_Cancel_2700 publish promise==================>'); }
setTimeout((async function(){ await notify.publish(notificationRequest);
await notify.unsubscribe(subscriber); console.info('===============ANS_Cancel_2800 publish promise==================>');
console.info('======ANS_Cancel_2700 setTimeout unsubscribe end==================>'); setTimeout((async function(){
done(); await notify.unsubscribe(subscriber);
}),timeout); 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.
先完成此消息的编辑!
想要评论请 注册