call initializeProvider where necessary

feature/default_network_editable
Erik Marks 4 years ago committed by Mark Stacey
parent 93f695d3c6
commit 30a59bb867
  1. 4
      test/unit/app/controllers/network/network-controller-test.js

@ -18,7 +18,6 @@ describe('NetworkController', function () {
.reply(200) .reply(200)
networkController = new NetworkController() networkController = new NetworkController()
networkController.initializeProvider(networkControllerProviderConfig)
}) })
afterEach(function () { afterEach(function () {
@ -37,7 +36,6 @@ describe('NetworkController', function () {
describe('#getNetworkState', function () { describe('#getNetworkState', function () {
it('should return loading when new', function () { it('should return loading when new', function () {
networkController = new NetworkController()
const networkState = networkController.getNetworkState() const networkState = networkController.getNetworkState()
assert.equal(networkState, 'loading', 'network is loading') assert.equal(networkState, 'loading', 'network is loading')
}) })
@ -53,11 +51,13 @@ describe('NetworkController', function () {
describe('#setProviderType', function () { describe('#setProviderType', function () {
it('should update provider.type', function () { it('should update provider.type', function () {
networkController.initializeProvider(networkControllerProviderConfig)
networkController.setProviderType('mainnet') networkController.setProviderType('mainnet')
const type = networkController.getProviderConfig().type const type = networkController.getProviderConfig().type
assert.equal(type, 'mainnet', 'provider type is updated') assert.equal(type, 'mainnet', 'provider type is updated')
}) })
it('should set the network to loading', function () { it('should set the network to loading', function () {
networkController.initializeProvider(networkControllerProviderConfig)
networkController.setProviderType('mainnet') networkController.setProviderType('mainnet')
const loading = networkController.isNetworkLoading() const loading = networkController.isNetworkLoading()
assert.ok(loading, 'network is loading') assert.ok(loading, 'network is loading')

Loading…
Cancel
Save