summaryrefslogtreecommitdiffstats
path: root/tests/querytest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-29 10:35:38 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-29 10:35:38 +0100
commit93250cfa247e223ea37f5ede29615b5a2969d8b0 (patch)
tree8e3da5242d46a8dc1c3abdd0117552977da66945 /tests/querytest.cpp
parent5a62f6ef857ef98812dd6ca30bc1e1049ccbf2ae (diff)
downloadsink-93250cfa247e223ea37f5ede29615b5a2969d8b0.tar.gz
sink-93250cfa247e223ea37f5ede29615b5a2969d8b0.zip
Fixed removal of entity
Diffstat (limited to 'tests/querytest.cpp')
-rw-r--r--tests/querytest.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp
index 3b62f56..6279fa9 100644
--- a/tests/querytest.cpp
+++ b/tests/querytest.cpp
@@ -263,7 +263,6 @@ private slots:
263 query.resourceFilter("sink.dummy.instance1"); 263 query.resourceFilter("sink.dummy.instance1");
264 query.requestTree<Folder::Parent>(); 264 query.requestTree<Folder::Parent>();
265 265
266 // We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data
267 auto model = Sink::Store::loadModel<Folder>(query); 266 auto model = Sink::Store::loadModel<Folder>(query);
268 QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); 267 QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool());
269 QCOMPARE(model->rowCount(), 1); 268 QCOMPARE(model->rowCount(), 1);
@@ -274,9 +273,15 @@ private slots:
274 VERIFYEXEC(Sink::Store::create<Folder>(subfolder)); 273 VERIFYEXEC(Sink::Store::create<Folder>(subfolder));
275 VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); 274 VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1"));
276 275
276 //Ensure the folder appears
277 model->fetchMore(model->index(0, 0)); 277 model->fetchMore(model->index(0, 0));
278 QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); 278 QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool());
279 QCOMPARE(model->rowCount(model->index(0, 0)), 1); 279 QCOMPARE(model->rowCount(model->index(0, 0)), 1);
280
281 //...and dissapears again after removal
282 VERIFYEXEC(Sink::Store::remove<Folder>(subfolder));
283 VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1"));
284 QTRY_COMPARE(model->rowCount(model->index(0, 0)), 0);
280 } 285 }
281 286
282 void testMailByMessageId() 287 void testMailByMessageId()