Add TestGui::testCloneEntry().

This commit is contained in:
Felix Geyer 2012-07-22 00:00:44 +02:00
parent 7bd080760e
commit edb644baef
2 changed files with 21 additions and 0 deletions

View File

@ -221,6 +221,26 @@ void TestGui::testSearch()
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()
{
EntryView* entryView = m_dbWidget->entryView();

View File

@ -38,6 +38,7 @@ private Q_SLOTS:
void testEditEntry();
void testAddEntry();
void testSearch();
void testCloneEntry();
void testDragAndDropEntry();
void testDragAndDropGroup();
void testSaveAs();