From f05fb0374fa3073018d95f2977751b57039ff97a Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:33:21 +0530 Subject: [PATCH] Add test for rawCodes with bad account names --- test/models/code_test.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/models/code_test.dart b/test/models/code_test.dart index 1521c4817..7eb91e901 100644 --- a/test/models/code_test.dart +++ b/test/models/code_test.dart @@ -19,4 +19,14 @@ void main() { expect(code.account, "testdata@ente.io", reason: "accountMismatch"); expect(code.secret, "ASKZNWOU6SVYAMVS"); }); +// + + test("parseWithFunnyAccountName", () { + final code = Code.fromRawData( + "otpauth://totp/Mongo Atlas:Acc !@#444?algorithm=sha1&digits=6&issuer=Mongo Atlas&period=30&secret=NI4CTTFEV4G2JFE6", + ); + expect(code.issuer, "Mongo Atlas", reason: "issuerMismatch"); + expect(code.account, "Acc !@#444", reason: "accountMismatch"); + expect(code.secret, "NI4CTTFEV4G2JFE6"); + }); }