aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Bouchon <mail@bitpshr.net>2019-04-18 01:34:49 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-04-18 01:34:49 +0800
commit0db0a187c8f30dcf332cf4d41a2f957171b25630 (patch)
treea57dc4e161dcefa8a2a96c9b14c24dbe1635588b /test
parent00133d31b15d070d55dff13f568cf828dad41424 (diff)
downloadtangerine-wallet-browser-0db0a187c8f30dcf332cf4d41a2f957171b25630.tar
tangerine-wallet-browser-0db0a187c8f30dcf332cf4d41a2f957171b25630.tar.gz
tangerine-wallet-browser-0db0a187c8f30dcf332cf4d41a2f957171b25630.tar.bz2
tangerine-wallet-browser-0db0a187c8f30dcf332cf4d41a2f957171b25630.tar.lz
tangerine-wallet-browser-0db0a187c8f30dcf332cf4d41a2f957171b25630.tar.xz
tangerine-wallet-browser-0db0a187c8f30dcf332cf4d41a2f957171b25630.tar.zst
tangerine-wallet-browser-0db0a187c8f30dcf332cf4d41a2f957171b25630.zip
feature: add Goerli support (#6459)
Diffstat (limited to 'test')
-rw-r--r--test/data/v17-long-history.json5
-rw-r--r--test/unit/app/controllers/infura-controller-test.js12
-rw-r--r--test/unit/app/controllers/network-contoller-test.js3
-rw-r--r--test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js5
-rw-r--r--test/unit/ui/etherscan-prefix-for-network.spec.js4
5 files changed, 24 insertions, 5 deletions
diff --git a/test/data/v17-long-history.json b/test/data/v17-long-history.json
index a33d425f8..cccb1ef96 100644
--- a/test/data/v17-long-history.json
+++ b/test/data/v17-long-history.json
@@ -54,7 +54,8 @@
"mainnet": "degraded",
"ropsten": "ok",
"kovan": "ok",
- "rinkeby": "ok"
+ "rinkeby": "ok",
+ "goerli": "ok"
}
},
"BlacklistController": {
@@ -3050,4 +3051,4 @@
]
}
}
-} \ No newline at end of file
+}
diff --git a/test/unit/app/controllers/infura-controller-test.js b/test/unit/app/controllers/infura-controller-test.js
index 7bd95dd4b..316f80378 100644
--- a/test/unit/app/controllers/infura-controller-test.js
+++ b/test/unit/app/controllers/infura-controller-test.js
@@ -4,7 +4,7 @@ const InfuraController = require('../../../../app/scripts/controllers/infura')
describe('infura-controller', function () {
let infuraController, sandbox, networkStatus
- const response = {'mainnet': 'degraded', 'ropsten': 'ok', 'kovan': 'ok', 'rinkeby': 'down'}
+ const response = {'mainnet': 'degraded', 'ropsten': 'ok', 'kovan': 'ok', 'rinkeby': 'down', 'goerli': 'ok'}
before(async function () {
infuraController = new InfuraController()
@@ -58,5 +58,15 @@ describe('infura-controller', function () {
assert.equal(networkStatus.rinkeby, 'down')
})
})
+
+ describe('Goerli', function () {
+ it('should have Goerli', function () {
+ assert.equal(Object.keys(networkStatus)[4], 'goerli')
+ })
+
+ it('should have a value for Goerli status', function () {
+ assert.equal(networkStatus.goerli, 'ok')
+ })
+ })
})
})
diff --git a/test/unit/app/controllers/network-contoller-test.js b/test/unit/app/controllers/network-contoller-test.js
index 7959e6cc1..32f7b337d 100644
--- a/test/unit/app/controllers/network-contoller-test.js
+++ b/test/unit/app/controllers/network-contoller-test.js
@@ -92,6 +92,9 @@ describe('Network utils', () => {
}, {
input: 'mainnet',
expected: 'Main Ethereum Network',
+ }, {
+ input: 'goerli',
+ expected: 'Goerli',
},
]
diff --git a/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js b/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js
index cb413545f..d3e47c67e 100644
--- a/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js
+++ b/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js
@@ -4,6 +4,7 @@ const {
ROPSTEN_CODE,
RINKEYBY_CODE,
KOVAN_CODE,
+ GOERLI_CODE,
} = require('../../../../../app/scripts/controllers/network/enums')
const KeyringController = require('eth-keyring-controller')
@@ -27,14 +28,14 @@ describe('Recipient Blacklist Checker', function () {
describe('#checkAccount', function () {
it('does not fail on test networks', function () {
let callCount = 0
- const networks = [ROPSTEN_CODE, RINKEYBY_CODE, KOVAN_CODE]
+ const networks = [ROPSTEN_CODE, RINKEYBY_CODE, KOVAN_CODE, GOERLI_CODE]
for (const networkId in networks) {
publicAccounts.forEach((account) => {
recipientBlackListChecker.checkAccount(networkId, account)
callCount++
})
}
- assert.equal(callCount, 30)
+ assert.equal(callCount, 40)
})
it('fails on mainnet', function () {
diff --git a/test/unit/ui/etherscan-prefix-for-network.spec.js b/test/unit/ui/etherscan-prefix-for-network.spec.js
index f0aeb8306..45e6e563d 100644
--- a/test/unit/ui/etherscan-prefix-for-network.spec.js
+++ b/test/unit/ui/etherscan-prefix-for-network.spec.js
@@ -23,4 +23,8 @@ describe('Etherscan Network Prefix', () => {
assert.equal(etherscanNetworkPrefix(42), 'kovan.')
})
+ it('returs goerli as prefix for networkId of 5', () => {
+ assert.equal(etherscanNetworkPrefix(5), 'goerli.')
+ })
+
})