diff options
author | Wolfram Rösler <wolfram@roesler-ac.de> | 2020-04-03 23:01:00 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2020-05-09 03:51:11 +0300 |
commit | 3c19fdd193336c9830fa112a720b42292c37e28b (patch) | |
tree | e260d462d3d90c56cf56580a3d3b45d62f738fb7 /tests | |
parent | ce8f32e7973b7f58eb360dd641c8e9b9f990dda3 (diff) |
Reports: Add "Known Bad" flag for entries
* Fixes #4168
* Introduce a custom data element stored with an entry to indicate that it is a "Known Bad" entry. This flag causes database reports to skip these entries.
* The current number of known bad entries is displayed in the statistics report.
* Add context menu to reports to easily exclude entries.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gui/TestGui.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index 3b97ffde8..7ce8a0f4a 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -45,6 +45,7 @@ #include "core/Entry.h" #include "core/Group.h" #include "core/Metadata.h" +#include "core/PasswordHealth.h" #include "core/Tools.h" #include "crypto/Crypto.h" #include "crypto/kdf/AesKdf.h" @@ -442,6 +443,17 @@ void TestGui::testEditEntry() QCOMPARE(entry->historyItems().size(), ++editCount); QVERIFY(!applyButton->isEnabled()); + // Test the "known bad" checkbox + editEntryWidget->setCurrentPage(1); + auto knownBadCheckBox = editEntryWidget->findChild<QCheckBox*>("knownBadCheckBox"); + QVERIFY(knownBadCheckBox); + QCOMPARE(knownBadCheckBox->isChecked(), false); + knownBadCheckBox->setChecked(true); + QTest::mouseClick(applyButton, Qt::LeftButton); + QCOMPARE(entry->historyItems().size(), ++editCount); + QCOMPARE(entry->customData()->contains(PasswordHealth::OPTION_KNOWN_BAD), true); + QCOMPARE(entry->customData()->value(PasswordHealth::OPTION_KNOWN_BAD), TRUE_STR); + // Test entry colors (simulate choosing a color) editEntryWidget->setCurrentPage(1); auto fgColor = QString("#FF0000"); |