Bug 1698506 - Fix browser_monthView.js and browser_weekView.js. r=mkmelin

These tests have started failing all of the time. The problem is that in
waiting for an event box, we're getting the existing box before it is
replaced by the new one we're waiting for.

Differential Revision: https://phabricator.services.mozilla.com/D109862

--HG--
extra : histedit_source : aa70d4c128685dbbf2ebd7ec04ef73bd32464234
This commit is contained in:
Geoff Lankow 2021-03-26 08:00:00 +00:00
Родитель e8a21522c1
Коммит b77de5c7c4
2 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -80,10 +80,16 @@ add_task(async function testMonthView() {
});
// Check if name was saved.
eventBox = await monthView.waitForItemAt(controller.window, 1, 5, 1);
eventBox = await TestUtils.waitForCondition(() => {
let newEventBox = monthView.getItemAt(controller.window, 1, 5, 1);
if (newEventBox && newEventBox != eventBox) {
return newEventBox;
}
return false;
});
let eventName = eventBox.querySelector(".event-name-label");
Assert.ok(eventName);
Assert.ok(eventName.value == TITLE2);
Assert.equal(eventName.value, TITLE2);
// Delete event.
controller.click(new elib.Elem(eventBox));

Просмотреть файл

@ -77,10 +77,16 @@ add_task(async function testWeekView() {
});
// Check if name was saved.
eventBox = await weekView.waitForEventBoxAt(controller.window, 5, 1);
eventBox = await TestUtils.waitForCondition(() => {
let newEventBox = weekView.getEventBoxAt(controller.window, 5, 1);
if (newEventBox && newEventBox != eventBox) {
return newEventBox;
}
return false;
});
let eventName = eventBox.querySelector(".calendar-event-details-core");
Assert.ok(eventName);
Assert.ok(eventName.textContent == TITLE2);
Assert.equal(eventName.textContent, TITLE2);
// Delete event.
controller.click(new elib.Elem(eventBox));