2021-05-07 21:38:24 +02:00
|
|
|
import { strict as assert } from 'assert';
|
2021-03-12 23:23:26 +01:00
|
|
|
import {
|
|
|
|
KOVAN_CHAIN_ID,
|
|
|
|
MAINNET_CHAIN_ID,
|
|
|
|
RINKEBY_CHAIN_ID,
|
|
|
|
ROPSTEN_CHAIN_ID,
|
|
|
|
} from '../../../shared/constants/network';
|
2021-03-16 22:00:08 +01:00
|
|
|
import getBuyEthUrl from './buy-eth-url';
|
2018-05-21 14:59:26 +02:00
|
|
|
|
2019-08-31 18:34:27 +02:00
|
|
|
describe('buy-eth-url', function () {
|
2018-05-21 14:59:26 +02:00
|
|
|
const mainnet = {
|
2021-03-12 23:23:26 +01:00
|
|
|
chainId: MAINNET_CHAIN_ID,
|
2018-05-21 14:59:26 +02:00
|
|
|
amount: 5,
|
|
|
|
address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-21 14:59:26 +02:00
|
|
|
const ropsten = {
|
2021-03-12 23:23:26 +01:00
|
|
|
chainId: ROPSTEN_CHAIN_ID,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-21 14:59:26 +02:00
|
|
|
const rinkeby = {
|
2021-03-12 23:23:26 +01:00
|
|
|
chainId: RINKEBY_CHAIN_ID,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-21 14:59:26 +02:00
|
|
|
const kovan = {
|
2021-03-12 23:23:26 +01:00
|
|
|
chainId: KOVAN_CHAIN_ID,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-21 14:59:26 +02:00
|
|
|
|
2019-11-22 16:13:23 +01:00
|
|
|
it('returns wyre url with address for network 1', function () {
|
2021-02-04 19:15:23 +01:00
|
|
|
const wyreUrl = getBuyEthUrl(mainnet);
|
2019-03-22 16:02:07 +01:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
assert.equal(
|
|
|
|
wyreUrl,
|
|
|
|
'https://pay.sendwyre.com/purchase?dest=ethereum:0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc&destCurrency=ETH&accountId=AC-7AG3W4XH4N2&paymentMethod=debit-card',
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
|
|
|
});
|
2018-05-21 14:59:26 +02:00
|
|
|
|
|
|
|
it('returns metamask ropsten faucet for network 3', function () {
|
2021-02-04 19:15:23 +01:00
|
|
|
const ropstenUrl = getBuyEthUrl(ropsten);
|
|
|
|
assert.equal(ropstenUrl, 'https://faucet.metamask.io/');
|
|
|
|
});
|
2018-05-21 14:59:26 +02:00
|
|
|
|
|
|
|
it('returns rinkeby dapp for network 4', function () {
|
2021-02-04 19:15:23 +01:00
|
|
|
const rinkebyUrl = getBuyEthUrl(rinkeby);
|
|
|
|
assert.equal(rinkebyUrl, 'https://www.rinkeby.io/');
|
|
|
|
});
|
2018-05-21 14:59:26 +02:00
|
|
|
|
|
|
|
it('returns kovan github test faucet for network 42', function () {
|
2021-02-04 19:15:23 +01:00
|
|
|
const kovanUrl = getBuyEthUrl(kovan);
|
|
|
|
assert.equal(kovanUrl, 'https://github.com/kovan-testnet/faucet');
|
|
|
|
});
|
|
|
|
});
|