MyCrypto/spec/reducers/config.spec.ts
James Prado 70a2b3ca9a Update Jest & Enzyme, Add snapshot tests (#307)
* 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

* Update Jest & Enzyme, Add snapshot tests

* Fix tslint errors in /spec, Update mock localstorage

* Update types in tests, Fix tslint error

* Specify module versions for browser

* Update sendTransaction snapshot
2017-10-24 19:17:26 -07:00

32 lines
863 B
TypeScript

import { config, INITIAL_STATE } from 'reducers/config';
import * as configActions from 'actions/config';
import { NODES } from 'config/data';
describe('config reducer', () => {
it('should handle CONFIG_LANGUAGE_CHANGE', () => {
const language = 'en';
expect(config(undefined, configActions.changeLanguage(language))).toEqual({
...INITIAL_STATE,
languageSelection: language
});
});
it('should handle CONFIG_NODE_CHANGE', () => {
const node = Object.keys(NODES)[0];
expect(config(undefined, configActions.changeNode(node))).toEqual({
...INITIAL_STATE,
nodeSelection: node
});
});
it('should handle CONFIG_GAS_PRICE', () => {
const gasPrice = 20;
expect(config(undefined, configActions.changeGasPrice(gasPrice))).toEqual({
...INITIAL_STATE,
gasPriceGwei: gasPrice
});
});
});