2017-08-24 10:53:59 +02:00
|
|
|
import { wallet, INITIAL_STATE } from 'reducers/wallet';
|
|
|
|
import * as walletActions from 'actions/wallet';
|
|
|
|
import Big from 'bignumber.js';
|
Sidebar refactor / style update (#173)
* Convert bootstrap to sass instead of checked in and less
* Darken body, adjust header.
* First pass at tab styles, each tab will need a lot of individual love tho.
* Update footer to main site content, improve responsiveness.
* Missing key added.
* Fix dropdowns.
* Convert GenerateWallet HTML over, still needs styling.
* Send form.
* Current rates styled.
* CurrencySwap form styles.
* SwapInfoHeader styled.
* Finish up swap restyling, minor usability improvements for mobile.
* Fix up notifications / alert customizations
* Import v3 variables.
* Fix notification spacing.
* Align input height base with buttons.
* Revert height base, add additional bootstrap overrides.
* Grid overrides.
* Move overrides to their own folder. Adjust naming.
* Fix inconsistencies.
* Style generate wallet pt 1.
* Style generate wallet pt 2
* Style generate wallet pt 3
* Fix swap
* Added some missing overries, fixed the fallout.
* Remove header text, indicate alpha version.
* Fix radio / checkbox weights.
* Bind => arrow
* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.
* Fix token balances buttons, footr icons.
* Break out files, style up account info.
* Style up token balances.
* Equivalent values styling.
* Sidebar promos.
* Fix up delete button and add custom form.
* Even spacing.
* Unlog
* Convert Big types to Ether types
* Fix test to expect Ether instead of Big
2017-09-08 15:26:51 -04:00
|
|
|
import { Ether } from 'libs/units';
|
2017-08-24 10:53:59 +02:00
|
|
|
|
|
|
|
describe('wallet reducer', () => {
|
|
|
|
it('should return the initial state', () => {
|
|
|
|
expect(wallet(undefined, {})).toEqual(INITIAL_STATE);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle WALLET_SET', () => {
|
|
|
|
const walletInstance = { wallet: true };
|
|
|
|
expect(wallet(undefined, walletActions.setWallet(walletInstance))).toEqual({
|
|
|
|
...INITIAL_STATE,
|
|
|
|
inst: walletInstance,
|
2017-09-12 15:15:23 -07:00
|
|
|
balance: null,
|
2017-08-24 10:53:59 +02:00
|
|
|
tokens: {}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle WALLET_SET_TOKEN_BALANCES', () => {
|
|
|
|
const tokenBalances = { OMG: new Big(20) };
|
|
|
|
expect(
|
|
|
|
wallet(undefined, walletActions.setTokenBalances(tokenBalances))
|
|
|
|
).toEqual({
|
|
|
|
...INITIAL_STATE,
|
|
|
|
tokens: tokenBalances
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|