summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-11 16:57:34 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-13 19:42:39 +0100
commitc2f3b5bae5a32d5b3573ed8256bf45231631751a (patch)
tree21fdcd7598e17d427ce0886ca746edbf66a979b0
parent720079d6a839b4d03eb0ceaa06d0ad2b446f7de1 (diff)
downloadsink-c2f3b5bae5a32d5b3573ed8256bf45231631751a.tar.gz
sink-c2f3b5bae5a32d5b3573ed8256bf45231631751a.zip
Ensure we don't accidentally pick up a dataChanaged signal from the
initial fetch.
-rw-r--r--tests/querytest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp
index b358621..ac55d0b 100644
--- a/tests/querytest.cpp
+++ b/tests/querytest.cpp
@@ -785,7 +785,8 @@ private slots:
785 query.request<Mail::MessageId>(); 785 query.request<Mail::MessageId>();
786 786
787 auto model = Sink::Store::loadModel<Mail>(query); 787 auto model = Sink::Store::loadModel<Mail>(query);
788 QTRY_COMPARE(model->rowCount(), 1); 788 QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool());
789 QCOMPARE(model->rowCount(), 1);
789 790
790 QSignalSpy insertedSpy(model.data(), &QAbstractItemModel::rowsInserted); 791 QSignalSpy insertedSpy(model.data(), &QAbstractItemModel::rowsInserted);
791 QSignalSpy removedSpy(model.data(), &QAbstractItemModel::rowsRemoved); 792 QSignalSpy removedSpy(model.data(), &QAbstractItemModel::rowsRemoved);
@@ -887,7 +888,8 @@ private slots:
887 query.request<Mail::Folder>(); 888 query.request<Mail::Folder>();
888 889
889 auto model = Sink::Store::loadModel<Mail>(query); 890 auto model = Sink::Store::loadModel<Mail>(query);
890 QTRY_COMPARE(model->rowCount(), 1); 891 QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool());
892 QCOMPARE(model->rowCount(), 1);
891 893
892 QSignalSpy insertedSpy(model.data(), &QAbstractItemModel::rowsInserted); 894 QSignalSpy insertedSpy(model.data(), &QAbstractItemModel::rowsInserted);
893 QSignalSpy removedSpy(model.data(), &QAbstractItemModel::rowsRemoved); 895 QSignalSpy removedSpy(model.data(), &QAbstractItemModel::rowsRemoved);