Add support for parsing counter

This commit is contained in:
Neeraj Gupta
2023-08-01 15:50:28 +05:30
parent e6a6f0a76f
commit 80d97734fd
3 changed files with 30 additions and 1 deletions

View File

@@ -19,6 +19,16 @@ void main() {
expect(code.account, "testdata@ente.io", reason: "accountMismatch");
expect(code.secret, "ASKZNWOU6SVYAMVS");
});
test("validateCount", () {
final code = Code.fromRawData(
"otpauth://hotp/testdata@ente.io?secret=ASKZNWOU6SVYAMVS&issuer=GitHub&counter=15",
);
expect(code.issuer, "GitHub", reason: "issuerMismatch");
expect(code.account, "testdata@ente.io", reason: "accountMismatch");
expect(code.secret, "ASKZNWOU6SVYAMVS");
expect(code.counter, 15);
});
//
test("parseWithFunnyAccountName", () {