From 93250cfa247e223ea37f5ede29615b5a2969d8b0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 29 Dec 2017 10:35:38 +0100 Subject: Fixed removal of entity --- tests/querytest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/querytest.cpp') 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: query.resourceFilter("sink.dummy.instance1"); query.requestTree(); - // We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data auto model = Sink::Store::loadModel(query); QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); @@ -274,9 +273,15 @@ private slots: VERIFYEXEC(Sink::Store::create(subfolder)); VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); + //Ensure the folder appears model->fetchMore(model->index(0, 0)); QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(model->index(0, 0)), 1); + + //...and dissapears again after removal + VERIFYEXEC(Sink::Store::remove(subfolder)); + VERIFYEXEC(Sink::ResourceControl::flushMessageQueue("sink.dummy.instance1")); + QTRY_COMPARE(model->rowCount(model->index(0, 0)), 0); } void testMailByMessageId() -- cgit v1.2.3