]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/dolphinmainwindowtest.cpp
Change the full row highlight checkbox to radiobuttons
[dolphin.git] / src / tests / dolphinmainwindowtest.cpp
index 448d5bd84b37ead4faee280b24e772a9b1a23a72..eefca42049622c033280f057cdb56b0b78f3fd85 100644 (file)
@@ -277,6 +277,7 @@ void DolphinMainWindowTest::testPlacesPanelWidthResistance()
 {
     m_mainWindow->openDirectories({ QUrl::fromLocalFile(QDir::homePath()) }, false);
     m_mainWindow->show();
+    m_mainWindow->resize(800, m_mainWindow->height()); // make sure the size is sufficient so a places panel resize shouldn't be necessary.
     QVERIFY(QTest::qWaitForWindowExposed(m_mainWindow.data()));
     QVERIFY(m_mainWindow->isVisible());
 
@@ -292,6 +293,16 @@ void DolphinMainWindowTest::testPlacesPanelWidthResistance()
     m_mainWindow->actionCollection()->action(QStringLiteral("show_filter_bar"))->trigger();
     QCOMPARE(placesPanel->width(), initialPlacesPanelWidth);
 
+    // Make all selection mode bars appear and test for each that this doesn't affect the places panel's width.
+    // One of the bottom bars (SelectionMode::BottomBar::GeneralContents) only shows up when at least one item is selected so we do that before we begin iterating.
+    m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::SelectAll))->trigger();
+    for (int selectionModeStates = SelectionMode::BottomBar::CopyContents; selectionModeStates != SelectionMode::BottomBar::RenameContents; selectionModeStates++) {
+        const auto contents = static_cast<SelectionMode::BottomBar::Contents>(selectionModeStates);
+        m_mainWindow->slotSetSelectionMode(true, contents);
+        QTest::qWait(20); // give time for a paint/resize
+        QCOMPARE(placesPanel->width(), initialPlacesPanelWidth);
+    }
+
     m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Find))->trigger();
     QCOMPARE(placesPanel->width(), initialPlacesPanelWidth);
 
@@ -330,6 +341,8 @@ void DolphinMainWindowTest::testGoActions()
     QScopedPointer<TestDir> testDir{new TestDir()};
     testDir->createDir("a");
     testDir->createDir("b");
+    testDir->createDir("b/b-1");
+    testDir->createFile("b/b-2");
     testDir->createDir("c");
     QUrl childDirUrl(QDir::cleanPath(testDir->url().toString() + "/b"));
     m_mainWindow->openDirectories({ childDirUrl }, false); // Open "b" dir