This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ class InfoAction {
3232 this . startingSyncTimestamp = response . best_header_timestamp || 0 ;
3333 }
3434 if ( ! response . synced_to_chain ) {
35- this . _notification . display ( { msg : 'Syncing to chain' , wait : true } ) ;
35+ this . _notification . display ( {
36+ msg : `Syncing to chain (block: ${ response . block_height } )` ,
37+ wait : true ,
38+ } ) ;
3639 log . info ( `Syncing to chain ... block height: ${ response . block_height } ` ) ;
3740 this . _store . percentSynced = this . calcPercentSynced ( response ) ;
3841 }
Original file line number Diff line number Diff line change @@ -42,6 +42,28 @@ describe('Action Info Unit Tests', () => {
4242 expect ( store . blockHeight , 'to equal' , 'some-height' ) ;
4343 } ) ;
4444
45+ it ( 'should show notification if syncing' , async ( ) => {
46+ grpc . sendCommand . withArgs ( 'getInfo' ) . resolves ( {
47+ synced_to_chain : false ,
48+ block_height : 1234 ,
49+ } ) ;
50+ await info . getInfo ( ) ;
51+ expect ( notification . display , 'was called once' ) ;
52+ expect ( notification . display , 'was called with' , {
53+ msg : 'Syncing to chain (block: 1234)' ,
54+ wait : true ,
55+ } ) ;
56+ } ) ;
57+
58+ it ( 'should not show notification if synced' , async ( ) => {
59+ grpc . sendCommand . withArgs ( 'getInfo' ) . resolves ( {
60+ synced_to_chain : true ,
61+ block_height : 1234 ,
62+ } ) ;
63+ await info . getInfo ( ) ;
64+ expect ( notification . display , 'was not called' ) ;
65+ } ) ;
66+
4567 it ( 'should return true if chain is synced' , async ( ) => {
4668 grpc . sendCommand . withArgs ( 'getInfo' ) . resolves ( {
4769 synced_to_chain : true ,
You can’t perform that action at this time.
0 commit comments