MyCrypto/spec/utils/tokens.spec.ts
William O'Beirne e7633c6d2f MyEtherWallet -> MyCrypto (#977)
* Replace all mentions of MyEtherWallet in translations with MyCrypto

* Replace all translation mentions of kvhnuke/etherwallet repo with MyCryptoHQ/MyCrypto repo.

* Replace all instances of MEW with MyCrypto in translations.

* Replace all instances of myetherwallet.com with mycrypto.com

* First pass of myetherwallet -> mycrypto in codebase.

* Replace most MEWs and mews with MyCrypto or MyC or myc

* Update all assets, clean out unused old assets.

* Adjust v3 url

* Convert all links to help articles to a help link component to make future changes easier.

* Rework onboarding images

* Adjust logo colors due to CMY issue.

* Update donation address, remove mentions of mewtopia.eth

* Update license

* Update sosh meed and referral links.

* Fix more translations strings.

* Tscheck fix.

* Update shapeshift api key.
2018-02-06 22:28:28 -06:00

48 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { dedupeCustomTokens } from 'utils/tokens';
describe('dedupeCustomTokens', () => {
const networkTokens = [
{
address: '0x48c80F1f4D53D5951e5D5438B54Cba84f29F32a5',
symbol: 'REP',
decimal: 18
},
{
address: '0xa74476443119A942dE498590Fe1f2454d7D4aC0d',
symbol: 'GNT',
decimal: 18
}
];
const DUPLICATE_ADDRESS = {
address: networkTokens[0].address,
symbol: 'REP2',
decimal: 18
};
const DUPLICATE_SYMBOL = {
address: '0x0',
symbol: networkTokens[1].symbol,
decimal: 18
};
const NONDUPLICATE_CUSTOM = {
address: '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8',
symbol: 'TEST',
decimal: 0
};
const customTokens = [DUPLICATE_ADDRESS, DUPLICATE_SYMBOL, NONDUPLICATE_CUSTOM];
const dedupedTokens = dedupeCustomTokens(networkTokens, customTokens);
it('Should remove duplicate address custom tokens', () => {
expect(dedupedTokens.includes(DUPLICATE_ADDRESS)).toBeFalsy();
});
it('Should remove duplicate symbol custom tokens', () => {
expect(dedupedTokens.includes(DUPLICATE_SYMBOL)).toBeFalsy();
});
it('Should not remove custom tokens that arent duplicates', () => {
expect(dedupedTokens.includes(NONDUPLICATE_CUSTOM)).toBeTruthy();
});
});