summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/clientapitest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp
index 78e1d1e..ff79c82 100644
--- a/tests/clientapitest.cpp
+++ b/tests/clientapitest.cpp
@@ -265,9 +265,18 @@ private Q_SLOTS:
265 Akonadi2::Query query; 265 Akonadi2::Query query;
266 query.liveQuery = false; 266 query.liveQuery = false;
267 267
268 int childrenFetchedCount = 0;
268 auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); 269 auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query);
270 QObject::connect(model.data(), &QAbstractItemModel::dataChanged, [&childrenFetchedCount](const QModelIndex &, const QModelIndex &, const QVector<int> &roles) {
271 if (roles.contains(Akonadi2::Store::ChildrenFetchedRole)) {
272 childrenFetchedCount++;
273 }
274 });
269 QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); 275 QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool());
270 QCOMPARE(model->rowCount(QModelIndex()), 2); 276 QCOMPARE(model->rowCount(QModelIndex()), 2);
277 //Ensure children fetched is only emitted once (when all resources are done)
278 QTest::qWait(50);
279 QCOMPARE(childrenFetchedCount, 1);
271 } 280 }
272 281
273 282