Skip to content

Commit

Permalink
fix: add test check
Browse files Browse the repository at this point in the history
  • Loading branch information
ieow committed Jan 13, 2025
1 parent 0689fc1 commit 5917fd4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/factors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ export const FactorManipulationTest = async (testVariable: FactorTestVariable) =

const browserFactor = await instance2.getDeviceFactor();

const factorBN = new BN(recoverFactor, "hex")

// login with mfa factor
await instance2.inputFactorKey(new BN(recoverFactor, "hex"));
assert.strictEqual(instance2.status, COREKIT_STATUS.LOGGED_IN);
Expand All @@ -167,6 +169,15 @@ export const FactorManipulationTest = async (testVariable: FactorTestVariable) =
const instance3 = await newInstance();
assert.strictEqual(instance3.status, COREKIT_STATUS.REQUIRED_SHARE);



try {
await instance3.inputFactorKey(factorBN.subn(1));
throw Error("should not be able to input factor");
} catch (e) {
assert(e instanceof Error);
}

await instance3.inputFactorKey(new BN(browserFactor, "hex"));
assert.strictEqual(instance3.status, COREKIT_STATUS.LOGGED_IN);
});
Expand Down

0 comments on commit 5917fd4

Please sign in to comment.