From 6381962924744ffed72e680b03cc26b7aa1208c5 Mon Sep 17 00:00:00 2001 From: smartltt Date: Wed, 12 Apr 2023 18:52:46 +0800 Subject: [PATCH] =?UTF-8?q?fixed=209d81634=20from=20https://gitee.com/smar?= =?UTF-8?q?tltt/xts=5Facts/pulls/8430=20master=20api=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: smartltt Change-Id: I9998a3b8ee3b440fdbfa667910282590684f15b9 --- .../src/main/js/test/ReminderAgentJs.test.js | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 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 6025bb74e..6ef45e062 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 @@ -2799,26 +2799,21 @@ export default function ReminderAgentTest() { let maxLimitNumsOfApp = 30; let firstId = 0; let secondId = 0; - let diffId = 0 - reminderAgent.cancelAllReminders().then(() =>{ - for (let i = 0; i < maxLimitNumsOfApp; i++) { - (function (i) { - setTimeout(function () { - reminderAgent.publishReminder(timer).then((reminderId) => { - if (i === 0) { - firstId = reminderId - } - if (i === 29) { - secondId = reminderId - diffId = secondId - firstId - expect(29).assertEqual(diffId); - done(); - } - }); - }, 500); - })(i); - } - }) + let diffId = 0; + let remiderId; + await reminderAgent.cancelAllReminders(); + for (let i = 0; i < maxLimitNumsOfApp; i++) { + remiderId = await reminderAgent.publishReminder(timer); + if (i === 0) { + firstId = reminderId + } + if (i === 29) { + secondId = reminderId + diffId = secondId - firstId + expect(29).assertEqual(diffId); + done(); + }; + } }) /** -- GitLab