diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-04-13 05:17:36 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-04-24 01:18:05 +0800 |
commit | 9e41f58af2f236389f11bd1d401da73c0d709b2d (patch) | |
tree | cf3cb4dbc49e4ac9fa4a5d8c4d08c32e9a6e8052 /test | |
parent | 74c419f9b65841c2966d1fe3b7414bf11e09e0d8 (diff) | |
download | tangerine-wallet-browser-9e41f58af2f236389f11bd1d401da73c0d709b2d.tar tangerine-wallet-browser-9e41f58af2f236389f11bd1d401da73c0d709b2d.tar.gz tangerine-wallet-browser-9e41f58af2f236389f11bd1d401da73c0d709b2d.tar.bz2 tangerine-wallet-browser-9e41f58af2f236389f11bd1d401da73c0d709b2d.tar.lz tangerine-wallet-browser-9e41f58af2f236389f11bd1d401da73c0d709b2d.tar.xz tangerine-wallet-browser-9e41f58af2f236389f11bd1d401da73c0d709b2d.tar.zst tangerine-wallet-browser-9e41f58af2f236389f11bd1d401da73c0d709b2d.zip |
Clean up network config
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/network-contoller-test.js | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/test/unit/network-contoller-test.js b/test/unit/network-contoller-test.js index dd0b52365..2b905718b 100644 --- a/test/unit/network-contoller-test.js +++ b/test/unit/network-contoller-test.js @@ -1,6 +1,10 @@ const assert = require('assert') const nock = require('nock') const NetworkController = require('../../app/scripts/controllers/network') +const { + getNetworkDisplayName, + getNetworkEndpoints, +} = require('../../app/scripts/controllers/network/util') const { createTestProviderTools } = require('../stub/provider') const providerResultStub = {} @@ -79,4 +83,40 @@ describe('# Network Controller', function () { }) }) }) -})
\ No newline at end of file +}) + +describe('# Network utils', () => { + it('getNetworkDisplayName should return the correct network name', () => { + const tests = [ + { + input: 3, + expected: 'Ropsten', + }, { + input: 4, + expected: 'Rinkeby', + }, { + input: 42, + expected: 'Kovan', + }, { + input: 'ropsten', + expected: 'Ropsten', + }, { + input: 'rinkeby', + expected: 'Rinkeby', + }, { + input: 'kovan', + expected: 'Kovan', + }, { + input: 'mainnet', + expected: 'Main Ethereum Network', + }, + ] + + tests.forEach(({ input, expected }) => assert.equal(getNetworkDisplayName(input), expected)) + }) + + it('getNetworkEndpoints should return the correct endpoints', () => { + assert.equal(getNetworkEndpoints('networkBeta').ropsten, 'https://ropsten.infura.io/metamask2') + assert.equal(getNetworkEndpoints('network').rinkeby, 'https://rinkeby.infura.io/metamask') + }) +}) |