diff options
author | Sami Vänttinen <sami.vanttinen@protonmail.com> | 2019-01-30 17:48:22 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2019-01-30 17:48:22 +0300 |
commit | 891f67a1cdbd88c4ff9d1f61fd82d1aff2a9d9a4 (patch) | |
tree | 81c73f376dadc651a85095607abb51278016c316 /tests/TestGroup.cpp | |
parent | 779b529da2f9c3d7204dcf1a32bf07feedc0d5aa (diff) |
Select group when adding credentials from browser extension (#2637)
Diffstat (limited to 'tests/TestGroup.cpp')
-rw-r--r-- | tests/TestGroup.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/TestGroup.cpp b/tests/TestGroup.cpp index 7abb808d1..6ea43b105 100644 --- a/tests/TestGroup.cpp +++ b/tests/TestGroup.cpp @@ -766,3 +766,35 @@ void TestGroup::testAddEntryWithPath() delete db; } + +void TestGroup::testIsRecycled() +{ + Database* db = new Database(); + db->rootGroup()->createRecycleBin(); + + Group* group1 = new Group(); + group1->setName("group1"); + group1->setParent(db->rootGroup()); + + Group* group2 = new Group(); + group2->setName("group2"); + group2->setParent(db->rootGroup()); + + Group* group3 = new Group(); + group3->setName("group3"); + group3->setParent(group2); + + Group* group4 = new Group(); + group4->setName("group4"); + group4->setParent(db->rootGroup()); + + db->recycleGroup(group2); + + QVERIFY(!group1->isRecycled()); + QVERIFY(group2->isRecycled()); + QVERIFY(group3->isRecycled()); + QVERIFY(!group4->isRecycled()); + + db->recycleGroup(group4); + QVERIFY(group4->isRecycled()); +} |