]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/kfileitemmodeltest.cpp
"Grouped sorting" defaults to true. Grouping is still disabled by default because...
[dolphin.git] / src / tests / kfileitemmodeltest.cpp
index fad825dc018b48f7208ee9f7bc73b8b3f28fd2f7..ea05f840b742f1009664391f489c4e94ed8cbe65 100644 (file)
@@ -164,7 +164,7 @@ void KFileItemModelTest::testDefaultSortRole()
 
 void KFileItemModelTest::testDefaultGroupedSorting()
 {
-    QCOMPARE(m_model->groupedSorting(), false);
+    QCOMPARE(m_model->groupedSorting(), true);
 }
 
 void KFileItemModelTest::testNewItems()
@@ -2007,6 +2007,7 @@ void KFileItemModelTest::testNameRoleGroups()
     m_testDir->createFiles({"b.txt", "c.txt", "d.txt", "e.txt"});
 
     m_model->setGroupedSorting(true);
+    m_model->setGroupRole("text");
     m_model->loadDirectory(m_testDir->url());
     QVERIFY(itemsInsertedSpy.wait());
     QCOMPARE(itemsInModel(),
@@ -2093,6 +2094,8 @@ void KFileItemModelTest::testNameRoleGroupsWithExpandedItems()
     m_testDir->createFiles({"a/b.txt", "a/c.txt", "d/e.txt", "d/f.txt"});
 
     m_model->setGroupedSorting(true);
+    m_model->setGroupRole("text");
+
     m_model->loadDirectory(m_testDir->url());
     QVERIFY(itemsInsertedSpy.wait());
     QCOMPARE(itemsInModel(),
@@ -2102,6 +2105,7 @@ void KFileItemModelTest::testNameRoleGroupsWithExpandedItems()
     QList<QPair<int, QVariant>> expectedGroups;
     expectedGroups << QPair<int, QVariant>(0, QLatin1String("A"));
     expectedGroups << QPair<int, QVariant>(1, QLatin1String("D"));
+
     QCOMPARE(m_model->groups(), expectedGroups);
 
     // Verify that expanding "a" and "d" will not change the groups (except for the index of "D").