aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-09-27 01:02:49 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-09-27 01:02:49 +0800
commit31e9dcf47063e1be7337d7d06b4c721e0f619951 (patch)
tree387e9be3afb0474426764b5b4ab28bd76d2e24e4 /test/unit
parent16ba2e6a30fc55bb1601d96696bd08ae177f631e (diff)
downloadtangerine-wallet-browser-31e9dcf47063e1be7337d7d06b4c721e0f619951.tar
tangerine-wallet-browser-31e9dcf47063e1be7337d7d06b4c721e0f619951.tar.gz
tangerine-wallet-browser-31e9dcf47063e1be7337d7d06b4c721e0f619951.tar.bz2
tangerine-wallet-browser-31e9dcf47063e1be7337d7d06b4c721e0f619951.tar.lz
tangerine-wallet-browser-31e9dcf47063e1be7337d7d06b4c721e0f619951.tar.xz
tangerine-wallet-browser-31e9dcf47063e1be7337d7d06b4c721e0f619951.tar.zst
tangerine-wallet-browser-31e9dcf47063e1be7337d7d06b4c721e0f619951.zip
Modify tests for new API.
Diffstat (limited to 'test/unit')
-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()
})