mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-19 07:32:34 +00:00
0d5d0cea9a
* Add disclaimer modal to footer * Remove duplicate code & unnecessary styles * Fix formatting noise * remove un-used css style * Fix tslint error & add media query for modals * Nest Media Query * Replace '???' with Spinner & update spinner * Add loading states for wallet balances * Update wallet test * Remove excess data passed to wallet balance reducer & Fix wallet balance types * Merge 'develop' into 'loading-indicator' * Add 'light' prop to Spinner * Only show spinners when fetching data * Remove format diff * Apply naming conventions * Remove network name when offline
33 lines
927 B
TypeScript
33 lines
927 B
TypeScript
import { wallet, INITIAL_STATE } from 'reducers/wallet';
|
|
import * as walletActions from 'actions/wallet';
|
|
import { TokenValue } from 'libs/units';
|
|
|
|
describe('wallet reducer', () => {
|
|
it('should handle WALLET_SET', () => {
|
|
const doSomething = new Promise<string>(resolve => {
|
|
setTimeout(() => resolve('Success'), 1000);
|
|
});
|
|
|
|
const walletInstance = {
|
|
getAddressString: () => doSomething,
|
|
signRawTransaction: () => doSomething,
|
|
signMessage: () => doSomething
|
|
};
|
|
|
|
expect(wallet(undefined, walletActions.setWallet(walletInstance))).toEqual({
|
|
...INITIAL_STATE,
|
|
inst: walletInstance
|
|
});
|
|
});
|
|
|
|
it('should handle WALLET_SET_TOKEN_BALANCES', () => {
|
|
const tokenBalances = { OMG: TokenValue('20') };
|
|
expect(
|
|
wallet(undefined, walletActions.setTokenBalances(tokenBalances))
|
|
).toEqual({
|
|
...INITIAL_STATE,
|
|
tokens: tokenBalances
|
|
});
|
|
});
|
|
});
|