From 75991321deab427e8b2f574b4fe32507b665099c Mon Sep 17 00:00:00 2001 From: exactlyaron Date: Thu, 23 Jan 2025 11:41:26 +0000 Subject: [PATCH] tests: fix tests --- tests/node/tests/operations.mjs | 14 +++++++------- tests/operations/tests/OTP.mjs | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/node/tests/operations.mjs b/tests/node/tests/operations.mjs index f3bfe7db..076fef6c 100644 --- a/tests/node/tests/operations.mjs +++ b/tests/node/tests/operations.mjs @@ -574,14 +574,14 @@ Top Drawer`, { assert.strictEqual(chef.fromUNIXTimestamp("978346800").toString(), "Mon 1 January 2001 11:00:00 UTC"); }), -// it("Generate HOTP", () => { -// const result = chef.generateHOTP("JBSWY3DPEHPK3PXP", { -// }); -// const expected = `URI: otpauth://hotp/?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&counter=0 + it("Generate HOTP", () => { + const result = chef.generateHOTP("JBSWY3DPEHPK3PXP", { + }); + const expected = `URI: otpauth://hotp/?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&counter=0 -// Password: 282760`; -// assert.strictEqual(result.toString(), expected); -// }), +Password: 282760`; + assert.strictEqual(result.toString(), expected); + }), it("Generate PGP Key Pair", async () => { const result = await chef.generatePGPKeyPair("Back To the Drawing Board", { diff --git a/tests/operations/tests/OTP.mjs b/tests/operations/tests/OTP.mjs index c34a46f2..ae15b350 100644 --- a/tests/operations/tests/OTP.mjs +++ b/tests/operations/tests/OTP.mjs @@ -11,13 +11,13 @@ import TestRegister from "../../lib/TestRegister.mjs"; TestRegister.addTests([ { name: "Generate HOTP", - input: "12345678901234567890", - expectedOutput: "URI: otpauth://hotp/OTPAuthentication?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\n\nPassword: 755224", + input: "JBSWY3DPEHPK3PXP", + expectedOutput: `URI: otpauth://hotp/?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&counter=0\n\nPassword: 282760`, recipeConfig: [ { op: "Generate HOTP", - args: ["", 32, 6, 0], + args: ["", 6, 0], // [Name, Code length, Counter] }, ], }, -]); +]); \ No newline at end of file