]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/kfileitemmodeltest.cpp
Merge remote-tracking branch 'fork/work/zakharafoniam/useful-groups'
[dolphin.git] / src / tests / kfileitemmodeltest.cpp
index 4c6db590d8c78bfb40b1d42a6f8d7b9a1a24823c..34ae2ba8721c02479005e5e7011053a4dfbc4b63 100644 (file)
@@ -165,7 +165,7 @@ void KFileItemModelTest::testDefaultSortRole()
 
 void KFileItemModelTest::testDefaultGroupedSorting()
 {
-    QCOMPARE(m_model->groupedSorting(), false);
+    QCOMPARE(m_model->groupedSorting(), true);
 }
 
 void KFileItemModelTest::testNewItems()
@@ -2094,6 +2094,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(),
@@ -2180,6 +2181,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(),
@@ -2189,6 +2192,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").