diff options
author | frankiebee <frankie.diamond@gmail.com> | 2018-05-23 07:45:20 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2018-05-23 07:45:20 +0800 |
commit | 61caee9d944615a48c43e4eb66b204c1e8b9ae6d (patch) | |
tree | 1ac62947cd2a740bbf63b8a045ff82e4deeeb250 /test/unit/app/buy-eth-url.spec.js | |
parent | c4b09da34e9950ea485dfecb810726e49b683dcd (diff) | |
parent | 145016be4c681b725d3450f59cb2892f0ec6d993 (diff) | |
download | tangerine-wallet-browser-61caee9d944615a48c43e4eb66b204c1e8b9ae6d.tar tangerine-wallet-browser-61caee9d944615a48c43e4eb66b204c1e8b9ae6d.tar.gz tangerine-wallet-browser-61caee9d944615a48c43e4eb66b204c1e8b9ae6d.tar.bz2 tangerine-wallet-browser-61caee9d944615a48c43e4eb66b204c1e8b9ae6d.tar.lz tangerine-wallet-browser-61caee9d944615a48c43e4eb66b204c1e8b9ae6d.tar.xz tangerine-wallet-browser-61caee9d944615a48c43e4eb66b204c1e8b9ae6d.tar.zst tangerine-wallet-browser-61caee9d944615a48c43e4eb66b204c1e8b9ae6d.zip |
Merge branch 'network-remove-provider-engine' of https://github.com/MetaMask/metamask-extension into transactions-use-new-block-tracker
Diffstat (limited to 'test/unit/app/buy-eth-url.spec.js')
-rw-r--r-- | test/unit/app/buy-eth-url.spec.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/unit/app/buy-eth-url.spec.js b/test/unit/app/buy-eth-url.spec.js new file mode 100644 index 000000000..36646fa68 --- /dev/null +++ b/test/unit/app/buy-eth-url.spec.js @@ -0,0 +1,48 @@ +const assert = require('assert') +const getBuyEthUrl = require('../../../app/scripts/lib/buy-eth-url') + +describe('', function () { + const mainnet = { + network: '1', + amount: 5, + address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', + } + const ropsten = { + network: '3', + } + const rinkeby = { + network: '4', + } + const kovan = { + network: '42', + } + + it('returns coinbase url with amount and address for network 1', function () { + const coinbaseUrl = getBuyEthUrl(mainnet) + const coinbase = coinbaseUrl.match(/(https:\/\/buy.coinbase.com)/) + const amount = coinbaseUrl.match(/(amount)\D\d/) + const address = coinbaseUrl.match(/(address)(.*)(?=&)/) + + assert.equal(coinbase[0], 'https://buy.coinbase.com') + assert.equal(amount[0], 'amount=5') + assert.equal(address[0], 'address=0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc') + + }) + + it('returns metamask ropsten faucet for network 3', function () { + const ropstenUrl = getBuyEthUrl(ropsten) + assert.equal(ropstenUrl, 'https://faucet.metamask.io/') + }) + + it('returns rinkeby dapp for network 4', function () { + const rinkebyUrl = getBuyEthUrl(rinkeby) + assert.equal(rinkebyUrl, 'https://www.rinkeby.io/') + }) + + it('returns kovan github test faucet for network 42', function () { + const kovanUrl = getBuyEthUrl(kovan) + assert.equal(kovanUrl, 'https://github.com/kovan-testnet/faucet') + }) + +}) + |