@@ -58,6 +58,11 @@ describe('Action Wallet Unit Tests', () => {
5858 wallet . setSeedVerify ( { word : 'FOO' , index : 1 } ) ;
5959 expect ( store . wallet . seedVerify [ 1 ] , 'to equal' , 'foo' ) ;
6060 } ) ;
61+
62+ it ( 'should trim whitespace' , ( ) => {
63+ wallet . setSeedVerify ( { word : ' foo ' , index : 1 } ) ;
64+ expect ( store . wallet . seedVerify [ 1 ] , 'to equal' , 'foo' ) ;
65+ } ) ;
6166 } ) ;
6267
6368 describe ( 'initSetPassword()' , ( ) => {
@@ -237,13 +242,15 @@ describe('Action Wallet Unit Tests', () => {
237242 } ) ;
238243
239244 it ( 'init wallet correctly during restore' , async ( ) => {
245+ const restoreSeed = [ 'hi' , 'hello' , 'hola' ] ;
246+ store . restoreSeedMnemonic = restoreSeed ;
240247 store . settings . restoring = true ;
241248 wallet . setNewPassword ( { password : 'secret123' } ) ;
242249 wallet . setPasswordVerify ( { password : 'secret123' } ) ;
243250 await wallet . checkNewPassword ( ) ;
244251 expect ( wallet . initWallet , 'was called with' , {
245252 walletPassword : 'secret123' ,
246- seedMnemonic : [ 'foo' , 'bar' , 'baz' ] ,
253+ seedMnemonic : restoreSeed ,
247254 recoveryWindow : RECOVERY_WINDOW ,
248255 } ) ;
249256 } ) ;
@@ -367,25 +374,25 @@ describe('Action Wallet Unit Tests', () => {
367374 it ( 'should clear attributes and navigate to view' , ( ) => {
368375 store . wallet . restoreIndex = 42 ;
369376 wallet . initRestoreWallet ( ) ;
370- expect ( store . seedMnemonic . length , 'to equal' , 24 ) ;
377+ expect ( store . restoreSeedMnemonic . length , 'to equal' , 24 ) ;
371378 expect ( store . wallet . restoreIndex , 'to equal' , 0 ) ;
372379 expect ( nav . goRestoreSeed , 'was called once' ) ;
373380 } ) ;
374381 } ) ;
375382
376383 describe ( 'setRestoreSeed()' , ( ) => {
377384 beforeEach ( ( ) => {
378- store . seedMnemonic = Array ( 24 ) . fill ( '' ) ;
385+ store . restoreSeedMnemonic = Array ( 24 ) . fill ( '' ) ;
379386 } ) ;
380387
381388 it ( 'should clear attributes' , ( ) => {
382389 wallet . setRestoreSeed ( { word : 'foo' , index : 1 } ) ;
383- expect ( store . seedMnemonic [ 1 ] , 'to equal' , 'foo' ) ;
390+ expect ( store . restoreSeedMnemonic [ 1 ] , 'to equal' , 'foo' ) ;
384391 } ) ;
385392
386393 it ( 'should trim whitespace' , ( ) => {
387394 wallet . setRestoreSeed ( { word : ' foo ' , index : 1 } ) ;
388- expect ( store . seedMnemonic [ 1 ] , 'to equal' , 'foo' ) ;
395+ expect ( store . restoreSeedMnemonic [ 1 ] , 'to equal' , 'foo' ) ;
389396 } ) ;
390397 } ) ;
391398
0 commit comments