mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
Now calls API functions with mock options.
This commit is contained in:
parent
d3d634d09c
commit
061fec1849
@ -1,4 +1,4 @@
|
|||||||
var assert = require('assert')
|
const assert = require('assert')
|
||||||
const extend = require('xtend')
|
const extend = require('xtend')
|
||||||
const STORAGE_KEY = 'metamask-persistance-key'
|
const STORAGE_KEY = 'metamask-persistance-key'
|
||||||
var configManagerGen = require('../lib/mock-config-manager')
|
var configManagerGen = require('../lib/mock-config-manager')
|
||||||
@ -47,11 +47,12 @@ describe('config-manager', function() {
|
|||||||
describe('#updateConversionRate', function() {
|
describe('#updateConversionRate', function() {
|
||||||
it('should retrieve an update for ETH to USD and set it in memory', function(done) {
|
it('should retrieve an update for ETH to USD and set it in memory', function(done) {
|
||||||
this.timeout(15000)
|
this.timeout(15000)
|
||||||
|
|
||||||
assert.equal(configManager.getConversionRate(), false)
|
assert.equal(configManager.getConversionRate(), false)
|
||||||
var promise = new Promise(
|
var promise = new Promise(
|
||||||
function (resolve, reject) {
|
function (resolve, reject) {
|
||||||
configManager.setCurrentFiat('USD')
|
configManager.setCurrentFiat('USD')
|
||||||
configManager.updateConversionRate().then(function() {
|
configManager.updateConversionRate(true, 'USD').then(function() {
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -69,10 +70,11 @@ describe('config-manager', function() {
|
|||||||
it('should work for JPY as well.', function() {
|
it('should work for JPY as well.', function() {
|
||||||
this.timeout(15000)
|
this.timeout(15000)
|
||||||
assert.equal(configManager.getConversionRate(), false)
|
assert.equal(configManager.getConversionRate(), false)
|
||||||
|
|
||||||
var promise = new Promise(
|
var promise = new Promise(
|
||||||
function (resolve, reject) {
|
function (resolve, reject) {
|
||||||
configManager.setCurrentFiat('JPY')
|
configManager.setCurrentFiat('JPY')
|
||||||
configManager.updateConversionRate().then(function() {
|
configManager.updateConversionRate(true, 'JPY').then(function() {
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user