@@ -597,20 +597,38 @@ describe('Action Wallet Unit Tests', () => {
597597 } ) ;
598598
599599 describe ( 'getExchangeRate()' , ( ) => {
600+ const json = `{
601+ "tickers": [
602+ {
603+ "date": "2019-04-04T03:30:05.000Z",
604+ "rate": 443302,
605+ "ticker": "EUR"
606+ },
607+ {
608+ "date": "2019-04-04T03:30:05.000Z",
609+ "rate": 378294,
610+ "ticker": "GBP"
611+ },
612+ {
613+ "date": "2019-04-04T03:30:05.000Z",
614+ "rate": 498467,
615+ "ticker": "USD"
616+ }
617+ ]
618+ }` ;
619+
600620 it ( 'should get exchange rate' , async ( ) => {
601- nock ( 'https://blockchain.info' )
602- . get ( '/tobtc' )
603- . query ( { currency : 'usd' , value : 1 } )
604- . reply ( 200 , '0.00011536' ) ;
621+ nock ( 'https://nodes.lightning.computer' )
622+ . get ( '/fiat/v1/btc-exchange-rates.json' )
623+ . reply ( 200 , json ) ;
605624 await wallet . getExchangeRate ( ) ;
606- expect ( store . settings . exchangeRate . usd , 'to be' , 0.00011536 ) ;
625+ expect ( store . settings . exchangeRate . usd , 'to be' , 0.000200615085853226 ) ;
607626 expect ( db . save , 'was called once' ) ;
608627 } ) ;
609628
610629 it ( 'should display notification on error' , async ( ) => {
611- nock ( 'https://blockchain.info' )
612- . get ( '/tobtc' )
613- . query ( { currency : 'usd' , value : 1 } )
630+ nock ( 'https://nodes.lightning.computer' )
631+ . get ( '/fiat/v1/btc-exchange-rates.json' )
614632 . reply ( 500 , 'Boom!' ) ;
615633 await wallet . getExchangeRate ( ) ;
616634 expect ( store . settings . exchangeRate . usd , 'to be' , undefined ) ;
0 commit comments