mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-29 17:48:46 -04:00
Add TestGui::testCloneEntry().
This commit is contained in:
parent
7bd080760e
commit
edb644baef
2 changed files with 21 additions and 0 deletions
|
@ -221,6 +221,26 @@ void TestGui::testSearch()
|
||||||
QCOMPARE(entryView->model()->rowCount(), 1);
|
QCOMPARE(entryView->model()->rowCount(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestGui::testCloneEntry()
|
||||||
|
{
|
||||||
|
EntryView* entryView = m_dbWidget->entryView();
|
||||||
|
|
||||||
|
QCOMPARE(entryView->model()->rowCount(), 1);
|
||||||
|
|
||||||
|
QModelIndex item = entryView->model()->index(0, 1);
|
||||||
|
Entry* entryOrg = entryView->entryFromIndex(item);
|
||||||
|
QRect itemRect = entryView->visualRect(item);
|
||||||
|
QTest::mouseClick(entryView->viewport(), Qt::LeftButton, Qt::NoModifier, itemRect.center());
|
||||||
|
QTest::qWait(20);
|
||||||
|
|
||||||
|
triggerAction("actionEntryClone");
|
||||||
|
|
||||||
|
QCOMPARE(entryView->model()->rowCount(), 2);
|
||||||
|
Entry* entryClone = entryView->entryFromIndex(entryView->model()->index(1, 1));
|
||||||
|
QVERIFY(entryOrg->uuid() != entryClone->uuid());
|
||||||
|
QCOMPARE(entryClone->title(), entryOrg->title());
|
||||||
|
}
|
||||||
|
|
||||||
void TestGui::testDragAndDropEntry()
|
void TestGui::testDragAndDropEntry()
|
||||||
{
|
{
|
||||||
EntryView* entryView = m_dbWidget->entryView();
|
EntryView* entryView = m_dbWidget->entryView();
|
||||||
|
|
|
@ -38,6 +38,7 @@ private Q_SLOTS:
|
||||||
void testEditEntry();
|
void testEditEntry();
|
||||||
void testAddEntry();
|
void testAddEntry();
|
||||||
void testSearch();
|
void testSearch();
|
||||||
|
void testCloneEntry();
|
||||||
void testDragAndDropEntry();
|
void testDragAndDropEntry();
|
||||||
void testDragAndDropGroup();
|
void testDragAndDropGroup();
|
||||||
void testSaveAs();
|
void testSaveAs();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue