@@ -5,6 +5,7 @@ import WalletAction from '../../../src/action/wallet';
5
5
import NavAction from '../../../src/action/nav' ;
6
6
import NavActionMobile from '../../../src/action/nav-mobile' ;
7
7
import NotificationAction from '../../../src/action/notification' ;
8
+ import PaymentAction from '../../../src/action/payment' ;
8
9
import * as logger from '../../../src/action/log' ;
9
10
import nock from 'nock' ;
10
11
import 'isomorphic-fetch' ;
@@ -18,6 +19,7 @@ describe('Action Wallet Unit Tests', () => {
18
19
let wallet ;
19
20
let nav ;
20
21
let notification ;
22
+ let payment ;
21
23
22
24
beforeEach ( ( ) => {
23
25
sandbox = sinon . createSandbox ( { } ) ;
@@ -30,7 +32,8 @@ describe('Action Wallet Unit Tests', () => {
30
32
db = sinon . createStubInstance ( AppStorage ) ;
31
33
notification = sinon . createStubInstance ( NotificationAction ) ;
32
34
nav = sinon . createStubInstance ( NavAction ) ;
33
- wallet = new WalletAction ( store , grpc , db , nav , notification ) ;
35
+ payment = sinon . createStubInstance ( PaymentAction ) ;
36
+ wallet = new WalletAction ( store , grpc , db , nav , notification , payment ) ;
34
37
} ) ;
35
38
36
39
afterEach ( ( ) => {
@@ -325,7 +328,7 @@ describe('Action Wallet Unit Tests', () => {
325
328
326
329
it ( 'should navigate to seed intro on mobile' , ( ) => {
327
330
nav = sinon . createStubInstance ( NavActionMobile ) ;
328
- wallet = new WalletAction ( store , grpc , db , nav , notification ) ;
331
+ wallet = new WalletAction ( store , grpc , db , nav , notification , payment ) ;
329
332
wallet . initSeed ( ) ;
330
333
expect ( nav . goSeedIntro , 'was called once' ) ;
331
334
} ) ;
@@ -437,15 +440,15 @@ describe('Action Wallet Unit Tests', () => {
437
440
store . walletAddress = 'non-null-addr' ;
438
441
wallet . initInitialDeposit ( ) ;
439
442
expect ( nav . goNewAddress , 'was called once' ) ;
440
- expect ( nav . goWait , 'was not called' ) ;
443
+ expect ( payment . initWaitScreen , 'was not called' ) ;
441
444
} ) ;
442
445
443
446
it ( 'should stay on wait screen until address is non-null' , async ( ) => {
444
447
store . walletAddress = null ;
445
448
wallet . initInitialDeposit ( ) ;
446
449
expect ( nav . goNewAddress , 'was not called' ) ;
447
450
store . walletAddress = 'non-null-addr' ;
448
- expect ( nav . goWait , 'was called once' ) ;
451
+ expect ( payment . initWaitScreen , 'was called once' ) ;
449
452
expect ( nav . goNewAddress , 'was called once' ) ;
450
453
} ) ;
451
454
} ) ;
@@ -510,7 +513,7 @@ describe('Action Wallet Unit Tests', () => {
510
513
expect ( grpc . sendUnlockerCommand , 'was called with' , 'UnlockWallet' , {
511
514
walletPassword : Buffer . from ( 'baz' , 'utf8' ) ,
512
515
} ) ;
513
- expect ( nav . goWait , 'was called once' ) ;
516
+ expect ( payment . initWaitScreen , 'was called once' ) ;
514
517
expect ( nav . goHome , 'was not called' ) ;
515
518
store . lndReady = true ;
516
519
store . walletAddress = 'some-address' ;
@@ -525,7 +528,7 @@ describe('Action Wallet Unit Tests', () => {
525
528
. rejects ( new Error ( 'Boom!' ) ) ;
526
529
await wallet . unlockWallet ( { walletPassword : 'baz' } ) ;
527
530
expect ( notification . display , 'was called once' ) ;
528
- expect ( nav . goWait , 'was called once' ) ;
531
+ expect ( payment . initWaitScreen , 'was called once' ) ;
529
532
expect ( store . walletUnlocked , 'to be' , false ) ;
530
533
expect ( store . wallet . password , 'to be' , '' ) ;
531
534
expect ( nav . goPassword , 'was called once' ) ;
0 commit comments