summaryrefslogtreecommitdiffstats
path: root/tests/maildirresourcetest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/maildirresourcetest.cpp')
-rw-r--r--tests/maildirresourcetest.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp
index d279a36..e6b6849 100644
--- a/tests/maildirresourcetest.cpp
+++ b/tests/maildirresourcetest.cpp
@@ -149,6 +149,30 @@ private Q_SLOTS:
149 QVERIFY(mailModel->rowCount(QModelIndex()) >= 1); 149 QVERIFY(mailModel->rowCount(QModelIndex()) >= 1);
150 } 150 }
151 151
152 void testSyncFolderMove()
153 {
154 Akonadi2::Query query;
155 query.resources << "org.kde.maildir.instance1";
156 query.syncOnDemand = true;
157 query.processAll = true;
158 query.requestedProperties << "name";
159
160 //Ensure all local data is processed
161 Akonadi2::Store::synchronize(query).exec().waitForFinished();
162
163 auto targetPath = tempDir.path() + QDir::separator() + "maildir1/";
164 QDir dir(targetPath);
165 QVERIFY(dir.rename("inbox", "newbox"));
166
167 //Ensure all local data is processed
168 Akonadi2::Store::synchronize(query).exec().waitForFinished();
169
170 auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query);
171 QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool());
172 QCOMPARE(model->rowCount(QModelIndex()), 2);
173 QCOMPARE(model->match(model->index(0, 0, QModelIndex()), Qt::DisplayRole, QStringLiteral("newbox"), 1).size(), 1);
174 }
175
152}; 176};
153 177
154QTEST_MAIN(MaildirResourceTest) 178QTEST_MAIN(MaildirResourceTest)