aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/currency-controller-test.js
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-09-28 13:32:07 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-28 13:32:07 +0800
commit5a1d50cd431819874f634679a1ea47fa64f9fbb4 (patch)
treefe76102102c875ee6eaaee8cb57829899936c519 /test/unit/currency-controller-test.js
parentdeee689426f0b6236093128b47be81faf56d6b75 (diff)
parentcdf41c28573822c7c4d50efe7dfa34a062825d7f (diff)
downloadtangerine-wallet-browser-5a1d50cd431819874f634679a1ea47fa64f9fbb4.tar
tangerine-wallet-browser-5a1d50cd431819874f634679a1ea47fa64f9fbb4.tar.gz
tangerine-wallet-browser-5a1d50cd431819874f634679a1ea47fa64f9fbb4.tar.bz2
tangerine-wallet-browser-5a1d50cd431819874f634679a1ea47fa64f9fbb4.tar.lz
tangerine-wallet-browser-5a1d50cd431819874f634679a1ea47fa64f9fbb4.tar.xz
tangerine-wallet-browser-5a1d50cd431819874f634679a1ea47fa64f9fbb4.tar.zst
tangerine-wallet-browser-5a1d50cd431819874f634679a1ea47fa64f9fbb4.zip
Merge branch 'master' into mmn
Diffstat (limited to 'test/unit/currency-controller-test.js')
-rw-r--r--test/unit/currency-controller-test.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/currency-controller-test.js b/test/unit/currency-controller-test.js
index 5eeaf9bcc..63ab60f9e 100644
--- a/test/unit/currency-controller-test.js
+++ b/test/unit/currency-controller-test.js
@@ -15,11 +15,11 @@ describe('currency-controller', function () {
describe('currency conversions', function () {
describe('#setCurrentCurrency', function () {
it('should return USD as default', function () {
- assert.equal(currencyController.getCurrentCurrency(), 'USD')
+ assert.equal(currencyController.getCurrentCurrency(), 'usd')
})
it('should be able to set to other currency', function () {
- assert.equal(currencyController.getCurrentCurrency(), 'USD')
+ assert.equal(currencyController.getCurrentCurrency(), 'usd')
currencyController.setCurrentCurrency('JPY')
var result = currencyController.getCurrentCurrency()
assert.equal(result, 'JPY')
@@ -36,12 +36,12 @@ describe('currency-controller', function () {
describe('#updateConversionRate', function () {
it('should retrieve an update for ETH to USD and set it in memory', function (done) {
this.timeout(15000)
- nock('https://api.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":""}')
+ nock('https://api.infura.io')
+ .get('/v1/ticker/ethusd')
+ .reply(200, '{"base": "ETH", "quote": "USD", "bid": 288.45, "ask": 288.46, "volume": 112888.17569277, "exchange": "bitfinex", "total_volume": 272175.00106721005, "num_exchanges": 8, "timestamp": 1506444677}')
assert.equal(currencyController.getConversionRate(), 0)
- currencyController.setCurrentCurrency('USD')
+ currencyController.setCurrentCurrency('usd')
currencyController.updateConversionRate()
.then(function () {
var result = currencyController.getConversionRate()
@@ -57,14 +57,14 @@ describe('currency-controller', function () {
this.timeout(15000)
assert.equal(currencyController.getConversionRate(), 0)
- nock('https://api.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":""}')
+ nock('https://api.infura.io')
+ .get('/v1/ticker/ethjpy')
+ .reply(200, '{"base": "ETH", "quote": "JPY", "bid": 32300.0, "ask": 32400.0, "volume": 247.4616071, "exchange": "kraken", "total_volume": 247.4616071, "num_exchanges": 1, "timestamp": 1506444676}')
var promise = new Promise(
function (resolve, reject) {
- currencyController.setCurrentCurrency('JPY')
+ currencyController.setCurrentCurrency('jpy')
currencyController.updateConversionRate().then(function () {
resolve()
})