Bug 1491269 - Follow-up: fix testTaskView.js failure by remembering the number of tasks before clicking delete; r=darktrojan
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Thu, 06 Dec 2018 14:04:59 +0200
changeset 33859 0e2cd56c3a6c626b0cd377d385f9a90f9646b2a9
parent 33858 b97c1a62e3d09bb93b3ae9b58462b3282ba9aeb6
child 33860 c474610d2c81ffb2986c8f20dff94adb29f8d3e7
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersdarktrojan
bugs1491269
Bug 1491269 - Follow-up: fix testTaskView.js failure by remembering the number of tasks before clicking delete; r=darktrojan
calendar/test/mozmill/views/testTaskView.js
--- a/calendar/test/mozmill/views/testTaskView.js
+++ b/calendar/test/mozmill/views/testTaskView.js
@@ -150,18 +150,18 @@ function testTaskView() {
     // Mark completed, verify.
     controller.click(eid("task-actions-markcompleted"));
     sleep();
 
     toolTipNode.ownerGlobal.showToolTip(toolTipNode, taskTreeNode.getTaskAtRow(0));
     controller.assertJSProperty(toolTipStatus, "textContent", "Completed");
 
     // Delete task and verify.
+    countBefore = taskTreeNode.mTaskArray.length;
     controller.click(eid("calendar-delete-task-button"));
-    countBefore = countAfter;
     controller.waitFor(() => {
         countAfter = taskTreeNode.mTaskArray.length;
         return countAfter == (countBefore - 1);
     }, "Task did not delete; countBefore=" + countBefore + ", countAfter=" + countAfter);
 }
 
 function teardownTest(module) {
     deleteCalendars(controller, CALENDARNAME);