Create history item when setting up a TOTP seed, resolves #1445

This commit is contained in:
Janek Bevendorff
2018-02-01 17:58:15 +01:00
parent 9c51e1af18
commit 17e3f1c21f
3 changed files with 15 additions and 0 deletions

View File

@@ -164,3 +164,15 @@ void TestTotp::testSteamTotp()
time = 1511200714;
QCOMPARE(Totp::generateTotp(seed, time, Totp::ENCODER_STEAM, 30), QString("9P3VP"));
}
void TestTotp::testEntryHistory()
{
Entry entry;
quint8 step = 16;
quint8 digits = 6;
QCOMPARE(entry.historyItems().size(), 0);
entry.setTotp("GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", step, digits);
QCOMPARE(entry.historyItems().size(), 1);
entry.setTotp("foo", step, digits);
QCOMPARE(entry.historyItems().size(), 2);
}