mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-11 11:34:26 +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
34 lines
992 B
TypeScript
34 lines
992 B
TypeScript
import { generateWallet, INITIAL_STATE } from 'reducers/generateWallet';
|
|
import * as generateWalletActions from 'actions/generateWallet';
|
|
import Wallet from 'ethereumjs-wallet';
|
|
|
|
describe('generateWallet reducer', () => {
|
|
it('should handle GENERATE_WALLET_GENERATE_WALLET', () => {
|
|
const { wallet, password, activeStep } = generateWallet(
|
|
undefined,
|
|
generateWalletActions.generateNewWallet('password')
|
|
);
|
|
|
|
expect(wallet).toBeInstanceOf(Wallet);
|
|
expect(password).toEqual('password');
|
|
expect(activeStep).toEqual('download');
|
|
});
|
|
|
|
it('should handle GENERATE_WALLET_CONTINUE_TO_PAPER', () => {
|
|
expect(
|
|
generateWallet(undefined, generateWalletActions.continueToPaper())
|
|
).toEqual({
|
|
...INITIAL_STATE,
|
|
activeStep: 'paper'
|
|
});
|
|
});
|
|
|
|
it('should handle GENERATE_WALLET_RESET', () => {
|
|
expect(
|
|
generateWallet(undefined, generateWalletActions.resetGenerateWallet())
|
|
).toEqual({
|
|
...INITIAL_STATE
|
|
});
|
|
});
|
|
});
|