Skip to content

Commit 5917fd4

Browse files
committed
fix: add test check
1 parent 0689fc1 commit 5917fd4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/factors.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ export const FactorManipulationTest = async (testVariable: FactorTestVariable) =
158158

159159
const browserFactor = await instance2.getDeviceFactor();
160160

161+
const factorBN = new BN(recoverFactor, "hex")
162+
161163
// login with mfa factor
162164
await instance2.inputFactorKey(new BN(recoverFactor, "hex"));
163165
assert.strictEqual(instance2.status, COREKIT_STATUS.LOGGED_IN);
@@ -167,6 +169,15 @@ export const FactorManipulationTest = async (testVariable: FactorTestVariable) =
167169
const instance3 = await newInstance();
168170
assert.strictEqual(instance3.status, COREKIT_STATUS.REQUIRED_SHARE);
169171

172+
173+
174+
try {
175+
await instance3.inputFactorKey(factorBN.subn(1));
176+
throw Error("should not be able to input factor");
177+
} catch (e) {
178+
assert(e instanceof Error);
179+
}
180+
170181
await instance3.inputFactorKey(new BN(browserFactor, "hex"));
171182
assert.strictEqual(instance3.status, COREKIT_STATUS.LOGGED_IN);
172183
});

0 commit comments

Comments
 (0)