mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-12 20:14:12 +00:00
c31490c8b4
* set return type in resetWallet action creator * update config reducer test * update generateWallet reducer test * update swap reducer test * update wallet reducer test * create customTokens reducer test * create deterministicWallets reducer test * create ens reducer test * create notifications reducer test * add crypto compare success/fail actions * add rates reducer test * remove unnecessary comments * remove more comments * remove duplicate import * update wallet reducer test to use BN * update dWallet reducer test to use BN * update wallet reducer tests * update rates reducer tests
38 lines
928 B
TypeScript
38 lines
928 B
TypeScript
import { customTokens } from 'reducers/customTokens';
|
|
import { Token } from 'config/data';
|
|
import * as customTokensActions from 'actions/customTokens';
|
|
|
|
describe('customTokens reducer', () => {
|
|
const token1: Token = {
|
|
address: 'address',
|
|
symbol: 'OMG',
|
|
decimal: 16
|
|
};
|
|
const token2: Token = {
|
|
address: 'address',
|
|
symbol: 'ANT',
|
|
decimal: 16
|
|
};
|
|
|
|
it('should handle CUSTOM_TOKEN_ADD', () => {
|
|
expect(
|
|
customTokens(undefined, customTokensActions.addCustomToken(token1))
|
|
).toEqual([token1]);
|
|
});
|
|
|
|
it('should handle CUSTOM_TOKEN_REMOVE', () => {
|
|
const state1 = customTokens(
|
|
undefined,
|
|
customTokensActions.addCustomToken(token1)
|
|
);
|
|
const state2 = customTokens(
|
|
state1,
|
|
customTokensActions.addCustomToken(token2)
|
|
);
|
|
|
|
expect(
|
|
customTokens(state2, customTokensActions.removeCustomToken(token2.symbol))
|
|
).toEqual([token1]);
|
|
});
|
|
});
|