diff --git a/autotests/unit/file/fileindexerconfigtest.h b/autotests/unit/file/fileindexerconfigtest.h --- a/autotests/unit/file/fileindexerconfigtest.h +++ b/autotests/unit/file/fileindexerconfigtest.h @@ -83,6 +83,11 @@ void folderShouldNotBeIndexedWithHiddenConfig(); void folderShouldNotBeIndexedWithHiddenConfig_data(); + void shouldIndexVaults(); + void shouldIndexVaults_data(); + void shouldByDefaultNotIndexVaults(); + void shouldByDefaultNotIndexVaults_data(); + private: void setupConfig(bool includeHidden); private: diff --git a/autotests/unit/file/fileindexerconfigtest.cpp b/autotests/unit/file/fileindexerconfigtest.cpp --- a/autotests/unit/file/fileindexerconfigtest.cpp +++ b/autotests/unit/file/fileindexerconfigtest.cpp @@ -197,3 +197,30 @@ QCOMPARE(m_config->shouldFolderBeIndexed(path), false); } + +void IndexerConfigTest::shouldByDefaultNotIndexVaults_data() +{ + writeIndexerConfig(QStringList{QDir::homePath()}, QStringList(), QStringList(), true); + +} + +void IndexerConfigTest::shouldByDefaultNotIndexVaults() +{ + QCOMPARE(m_config->shouldBeIndexed(QStringLiteral("%1/Vaults").arg(QDir::homePath())), false); +} + +void IndexerConfigTest::shouldIndexVaults_data() +{ + const auto vault = QStringLiteral("%1/Vaults").arg(QDir::homePath()); + QTest::addColumn("path"); + QTest::addRow("%s", qPrintable(vault)) << vault; + + writeIndexerConfig(QStringList{vault}, QStringList(), QStringList(), true); + +} + +void IndexerConfigTest::shouldIndexVaults() +{ + QFETCH(QString, path); + QCOMPARE(m_config->shouldBeIndexed(path), true); +}