From 611a74d74dd88774587e716daebbb81f2a619609 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 29 Sep 2017 17:05:30 -0400 Subject: [PATCH] Added tests to confirm mismatched passwords block saving --- tests/gui/TestGui.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index 9abe31f38..75ce3cc59 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -268,6 +268,17 @@ void TestGui::testEditEntry() QCOMPARE(attrTextEdit->toPlainText(), attrText); editEntryWidget->setCurrentPage(0); + // Test mismatch passwords + QLineEdit* passwordEdit = editEntryWidget->findChild("passwordEdit"); + QString originalPassword = passwordEdit->text(); + passwordEdit->setText("newpass"); + QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); + MessageWidget* messageWiget = editEntryWidget->findChild("messageWidget"); + QTRY_VERIFY(messageWiget->isVisible()); + QCOMPARE(m_dbWidget->currentMode(), DatabaseWidget::EditMode); + QCOMPARE(passwordEdit->text(), QString("newpass")); + passwordEdit->setText(originalPassword); + // Save the edit (press OK) QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);