diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-04-24 06:49:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 06:49:17 +0800 |
commit | 4289f813e9f90a38b98f1d067d4e7556438641c8 (patch) | |
tree | 8bf154eedeb9c66ca2377aca010d3b80453a22dc /test | |
parent | f1c0d8ad6e5dd99dae723b9bc0ca80bed27e8bc1 (diff) | |
parent | 9e41f58af2f236389f11bd1d401da73c0d709b2d (diff) | |
download | tangerine-wallet-browser-4289f813e9f90a38b98f1d067d4e7556438641c8.tar tangerine-wallet-browser-4289f813e9f90a38b98f1d067d4e7556438641c8.tar.gz tangerine-wallet-browser-4289f813e9f90a38b98f1d067d4e7556438641c8.tar.bz2 tangerine-wallet-browser-4289f813e9f90a38b98f1d067d4e7556438641c8.tar.lz tangerine-wallet-browser-4289f813e9f90a38b98f1d067d4e7556438641c8.tar.xz tangerine-wallet-browser-4289f813e9f90a38b98f1d067d4e7556438641c8.tar.zst tangerine-wallet-browser-4289f813e9f90a38b98f1d067d4e7556438641c8.zip |
Merge pull request #3968 from MetaMask/gh-3653
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') + }) +}) |