diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2019-12-06 18:52:12 +0300 |
---|---|---|
committer | Hannah von Reth <hannah.vonreth@owncloud.com> | 2019-12-06 18:52:12 +0300 |
commit | ac1102070f737fb37f006c737d25a6279fa6a823 (patch) | |
tree | dbd687a54f35395656195ea75ae589ff07fe726b /test | |
parent | 3461c0668e190cec8a3dff5f5bbd56afdea531cb (diff) | |
parent | 86c1a666600ee6f83b4c56a77f2a7cc09f281c81 (diff) |
Merge branch '2.6'
Diffstat (limited to 'test')
-rw-r--r-- | test/testallfilesdeleted.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/testallfilesdeleted.cpp b/test/testallfilesdeleted.cpp index e49506a6b..e5505fb0f 100644 --- a/test/testallfilesdeleted.cpp +++ b/test/testallfilesdeleted.cpp @@ -295,6 +295,32 @@ private slots: QCOMPARE(aboutToRemoveAllFilesCalled, 0); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); } + + void testSelectiveSyncNoPopup() { + // Unselecting all folder should not cause the popup to be shown + FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()}; + + int aboutToRemoveAllFilesCalled = 0; + QObject::connect(&fakeFolder.syncEngine(), &SyncEngine::aboutToRemoveAllFiles, + [&](SyncFileItem::Direction , bool *) { + aboutToRemoveAllFilesCalled++; + QFAIL("should not be called"); + }); + + QVERIFY(fakeFolder.syncOnce()); + QCOMPARE(aboutToRemoveAllFilesCalled, 0); + QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); + + fakeFolder.syncEngine().journal()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, + QStringList() << "A/" << "B/" << "C/" << "S/"); + + QVERIFY(fakeFolder.syncOnce()); + QCOMPARE(fakeFolder.currentLocalState(), FileInfo{}); // all files should be one localy + QCOMPARE(fakeFolder.currentRemoteState(), FileInfo::A12_B12_C12_S12()); // Server not changed + QCOMPARE(aboutToRemoveAllFilesCalled, 0); // But we did not show the popup + } + + }; QTEST_GUILESS_MAIN(TestAllFilesDeleted) |