From e4bac8aaefc1cfcbf6e8c765cc1ebbf45ebd293c Mon Sep 17 00:00:00 2001 From: nan-xiansen Date: Mon, 7 Nov 2022 21:01:10 +0800 Subject: [PATCH] =?UTF-8?q?fixed=205df40a3=20from=20https://gitee.com/nan-?= =?UTF-8?q?xiansen/xts=5Facts/pulls/6411=20=E3=80=90resourceschedule?= =?UTF-8?q?=E3=80=91=E3=80=90master=E3=80=91reminderagent=20module:modify?= =?UTF-8?q?=20problem=20cases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nan-xiansen Change-Id: Id6351d14276ff04fd10a857084a0ceafbb5b3f6e --- .../src/main/js/test/ReminderAgentJs.test.js | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/ReminderAgentJs.test.js b/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/ReminderAgentJs.test.js index 7386a81d4..5b0e30fe5 100644 --- a/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/ReminderAgentJs.test.js +++ b/resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/ReminderAgentJs.test.js @@ -2851,11 +2851,14 @@ describe('ReminderAgentTest', function () { type: 1 } reminderAgent.addNotificationSlot(tarRemoveSlot.type, (err, data) => { - reminderAgent.removeNotificationSlot(tarRemoveSlot.type, (err, data) => { - expect(0).assertEqual(err.code); - }); + console.info('addNotificationSlot 106 err code:'+err.code) + }); + reminderAgent.removeNotificationSlot(tarRemoveSlot.type, (err, data) => { + + console.info('err code 106 is :' + err.code) + expect(err.code).assertEqual(67108888); + done(); }); - done(); }) /** @@ -2866,14 +2869,16 @@ describe('ReminderAgentTest', function () { it('testRemoveNotificationSlotNorFun_0107', 0, async function (done) { console.info('----------------------testRemoveNotificationSlotNorFun_0107---------------------------'); let tarRemoveSlot = { - type: 1 + type: 2 } reminderAgent.addNotificationSlot(tarRemoveSlot.type, (err, data) => { + console.info('addNotificationSlot err code is :' + err.code) reminderAgent.removeNotificationSlot(tarRemoveSlot.type).then(() => { - expect(0).assertEqual(err.code); + console.info('err code 107 is :' + err.code) + expect(err.code).assertEqual(401); + done(); }); }); - done(); }) /** @@ -2888,12 +2893,11 @@ describe('ReminderAgentTest', function () { triggerTimeInSeconds: 3 } reminderAgent.publishReminder(timer).then((reminderId) => { }); - setTimeout(() => { reminderAgent.getValidReminders().then((reminders) => { - expect(0).assertEqual(reminders.length); + console.info('reminders length is :' + reminders.length) + expect(reminders.length).assertLarger(0) + done() }); - }, 5000); - done(); }) /** @@ -2907,13 +2911,14 @@ describe('ReminderAgentTest', function () { reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, triggerTimeInSeconds: 3 } + reminderAgent.cancelAllReminders().than(() => {}) reminderAgent.publishReminder(timer).then((reminderId) => { }); - setTimeout(() => { + reminderAgent.getValidReminders((err, reminders) => { - expect(0).assertEqual(reminders.length); + console.info('reminder length 109 is :' + reminders.length) + expect(reminders.length).assertEqual(0); + done() }); - }, 5000); - done(); }) /** -- GitLab