File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments