Fix first entry is not selected when a search is performed (#9868)

This commit is contained in:
Colfenor 2023-09-25 15:21:28 +02:00 committed by Jonathan White
parent 394c0375b7
commit 762fd9462f
2 changed files with 9 additions and 1 deletions

View file

@ -1078,6 +1078,13 @@ void TestGui::testSearch()
QCOMPARE(groupView->currentGroup(), m_db->rootGroup());
QVERIFY(!m_dbWidget->isSearchActive());
// check if first entry is selected after search
QTest::keyClicks(searchTextEdit, "some");
QTRY_VERIFY(m_dbWidget->isSearchActive());
QTRY_COMPARE(entryView->selectedEntries().length(), 1);
QModelIndex index_current = entryView->indexFromEntry(entryView->currentEntry());
QTRY_COMPARE(index_current.row(), 0);
// Try to edit the first entry from the search view
// Refocus back to search edit
QTest::mouseClick(searchTextEdit, Qt::LeftButton);