diff options
Diffstat (limited to 'tests/clientapitest.cpp')
-rw-r--r-- | tests/clientapitest.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 94818e1..80cf2c4 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp | |||
@@ -189,32 +189,11 @@ private slots: | |||
189 | query.requestTree("parent"); | 189 | query.requestTree("parent"); |
190 | 190 | ||
191 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); | 191 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); |
192 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 192 | QTRY_COMPARE(model->rowCount(), 1); |
193 | QCOMPARE(model->rowCount(), 1); | ||
194 | model->fetchMore(model->index(0, 0)); | 193 | model->fetchMore(model->index(0, 0)); |
195 | QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); | 194 | QTRY_COMPARE(model->rowCount(model->index(0, 0)), 1); |
196 | QCOMPARE(model->rowCount(model->index(0, 0)), 1); | ||
197 | } | 195 | } |
198 | 196 | ||
199 | void testModelSignals() | ||
200 | { | ||
201 | auto facade = setupFacade<Sink::ApplicationDomain::Folder>("dummyresource.instance1"); | ||
202 | auto folder = QSharedPointer<Sink::ApplicationDomain::Folder>::create("resource", "id", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | ||
203 | auto subfolder = QSharedPointer<Sink::ApplicationDomain::Folder>::create("resource", "subId", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | ||
204 | subfolder->setParent("id"); | ||
205 | facade->results << folder << subfolder; | ||
206 | |||
207 | // Test | ||
208 | Sink::Query query; | ||
209 | query.resourceFilter("dummyresource.instance1"); | ||
210 | query.requestTree("parent"); | ||
211 | |||
212 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); | ||
213 | QSignalSpy spy(model.data(), SIGNAL(rowsInserted(const QModelIndex &, int, int))); | ||
214 | QVERIFY(spy.isValid()); | ||
215 | model->fetchMore(model->index(0, 0)); | ||
216 | QTRY_VERIFY(spy.count() >= 1); | ||
217 | } | ||
218 | 197 | ||
219 | void testModelNestedLive() | 198 | void testModelNestedLive() |
220 | { | 199 | { |