Skip to content

Commit

Permalink
[nemo-qml-plugin-calendar] Fixup calendarevent unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaliste committed Apr 22, 2021
1 parent 2537ef4 commit 12fff76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/tst_calendarevent/tst_calendarevent.cpp
Expand Up @@ -80,6 +80,8 @@ void tst_CalendarEvent::initTestCase()

// Ensure a default notebook exists for saving new events
CalendarManager *manager = CalendarManager::instance();
// Need to wait for the notebooks to be loaded from worker;
QTest::qWait(1000);
if (manager->defaultNotebook().isEmpty()) {
manager->setDefaultNotebook(manager->notebooks().value(0).uid);
}
Expand Down Expand Up @@ -458,7 +460,7 @@ void tst_CalendarEvent::testRecurrenceException()
}
QVERIFY(modificationFound);

// ensure all gone
// ensure all gone, this emits two warning for not finding the two occurrences.
calendarApi->removeAll(uid);
mSavedEvents.remove(uid);
occurrence = CalendarManager::instance()->getNextOccurrence(uid, QDateTime(), startTime.addDays(-1));
Expand Down Expand Up @@ -489,6 +491,9 @@ bool tst_CalendarEvent::saveEvent(CalendarEventModification *eventMod, QString *
return false;
}

if (eventMod->calendarUid().isEmpty()) {
eventMod->setCalendarUid(CalendarManager::instance()->defaultNotebook());
}
eventMod->save();
for (int i = 0; i < 30; i++) {
if (agendaModel.count() > count)
Expand Down

0 comments on commit 12fff76

Please sign in to comment.