summaryrefslogtreecommitdiffstats
path: root/tests/test_calendarwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_calendarwindow.cpp')
-rw-r--r--tests/test_calendarwindow.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_calendarwindow.cpp b/tests/test_calendarwindow.cpp
index 5591b2b..ea83f12 100644
--- a/tests/test_calendarwindow.cpp
+++ b/tests/test_calendarwindow.cpp
@@ -128,6 +128,7 @@ private slots:
void aFreshWindowShowsTheCurrentMonth();
void aStaleSaveCanBeRetried();
void aRolledBackWriteIsNotReportedLostAfterSync();
+ void escapeClosesTheDetailsButNotAnEditFromOutsideThePane();
};
void TestCalendarWindow::loadsAndSelects()
@@ -320,5 +321,23 @@ void TestCalendarWindow::aRolledBackWriteIsNotReportedLostAfterSync()
5000);
}
+
+void TestCalendarWindow::escapeClosesTheDetailsButNotAnEditFromOutsideThePane()
+{
+ Fixture f;
+ std::unique_ptr<CalendarWindow> w(f.window());
+ auto *close = w->findChild<QAction *>(QStringLiteral("cancelEdit"));
+ QVERIFY(close);
+ QVERIFY(w->selectEvent(QStringLiteral("one@example.org")));
+ close->trigger();
+ QVERIFY(w->selectedUid().isEmpty());
+
+ // Focus is nowhere inside the pane, as after a click on the grid.
+ QVERIFY(w->selectEvent(QStringLiteral("one@example.org")));
+ editTitle(w.get(), QStringLiteral("Changed"));
+ close->trigger();
+ QVERIFY(w->isEditing());
+}
+
QTEST_MAIN(TestCalendarWindow)
#include "test_calendarwindow.moc"