Skip to content

Commit

Permalink
add test to verify that after search selected entry is at top row
Browse files Browse the repository at this point in the history
  • Loading branch information
Colfenor committed Sep 24, 2023
1 parent c3f5909 commit 73fa860
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/gui/TestGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,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);
Expand Down

0 comments on commit 73fa860

Please sign in to comment.