diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-08-25 07:15:43 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-08-25 07:15:43 +0800 |
commit | eee08457e51c6d4a4d4817671b93fa57933e338f (patch) | |
tree | 53f6d83ded894c0b4b16b92cf81bcabb82eff818 /test | |
parent | 15c8680e21cce1295dd3ec2959bd96373c1f4451 (diff) | |
parent | c8c77aa8bd03125261e094b0cb264ed9fa9d9d77 (diff) | |
download | tangerine-wallet-browser-eee08457e51c6d4a4d4817671b93fa57933e338f.tar tangerine-wallet-browser-eee08457e51c6d4a4d4817671b93fa57933e338f.tar.gz tangerine-wallet-browser-eee08457e51c6d4a4d4817671b93fa57933e338f.tar.bz2 tangerine-wallet-browser-eee08457e51c6d4a4d4817671b93fa57933e338f.tar.lz tangerine-wallet-browser-eee08457e51c6d4a4d4817671b93fa57933e338f.tar.xz tangerine-wallet-browser-eee08457e51c6d4a4d4817671b93fa57933e338f.tar.zst tangerine-wallet-browser-eee08457e51c6d4a4d4817671b93fa57933e338f.zip |
Merge branch 'master' into i484PersistPendingSignatures
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/config-manager-test.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/unit/config-manager-test.js b/test/unit/config-manager-test.js index eaa5376fd..6aa7146f0 100644 --- a/test/unit/config-manager-test.js +++ b/test/unit/config-manager-test.js @@ -1,9 +1,10 @@ -var assert = require('assert') +const assert = require('assert') const extend = require('xtend') const STORAGE_KEY = 'metamask-persistance-key' var configManagerGen = require('../lib/mock-config-manager') var configManager const rp = require('request-promise') +const nock = require('nock') describe('config-manager', function() { @@ -47,6 +48,10 @@ describe('config-manager', function() { describe('#updateConversionRate', function() { it('should retrieve an update for ETH to USD and set it in memory', function(done) { this.timeout(15000) + var usdMock = nock('https://www.cryptonator.com') + .get('/api/ticker/eth-USD') + .reply(200, '{"ticker":{"base":"ETH","target":"USD","price":"11.02456145","volume":"44948.91745289","change":"-0.01472534"},"timestamp":1472072136,"success":true,"error":""}') + assert.equal(configManager.getConversionRate(), false) var promise = new Promise( function (resolve, reject) { @@ -69,6 +74,12 @@ describe('config-manager', function() { it('should work for JPY as well.', function() { this.timeout(15000) assert.equal(configManager.getConversionRate(), false) + + var jpyMock = nock('https://www.cryptonator.com') + .get('/api/ticker/eth-JPY') + .reply(200, '{"ticker":{"base":"ETH","target":"JPY","price":"11.02456145","volume":"44948.91745289","change":"-0.01472534"},"timestamp":1472072136,"success":true,"error":""}') + + var promise = new Promise( function (resolve, reject) { configManager.setCurrentFiat('JPY') |