X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/79a71ae1839b1a68c61f2020fdfd37175d59cf06..c073cd3c9ac8fc91f4aafe1aefba70ccac7905b1:/src/tests/dolphinmainwindowtest.cpp diff --git a/src/tests/dolphinmainwindowtest.cpp b/src/tests/dolphinmainwindowtest.cpp index cd68bb893..6ac85e4f0 100644 --- a/src/tests/dolphinmainwindowtest.cpp +++ b/src/tests/dolphinmainwindowtest.cpp @@ -456,6 +456,18 @@ void DolphinMainWindowTest::testFocusPlacesPanel() showPlacesPanelAction->trigger(); QVERIFY(placesPanel->isVisible()); QVERIFY2(placesPanel->hasFocus(), "Enabling the Places panel should move keyboard focus there."); + + /// Test that activating a place always moves focus to the view. + QTest::keyClick(QApplication::focusWidget(), Qt::Key::Key_Enter); + QVERIFY2(m_mainWindow->activeViewContainer()->isAncestorOf(QApplication::focusWidget()), + "Activating a place should move focus to the view that loads that place."); + + focusPlacesPanelAction->trigger(); + QVERIFY(placesPanel->hasFocus()); + + QTest::keyClick(QApplication::focusWidget(), Qt::Key::Key_Enter); + QVERIFY2(m_mainWindow->activeViewContainer()->isAncestorOf(QApplication::focusWidget()), + "Activating a place should move focus to the view even if the view already has that place loaded."); } /**