17 lines
599 B
TypeScript
17 lines
599 B
TypeScript
|
import { actions } from '../nodes/selectedNode.spec';
|
||
|
import { selectedNetwork } from 'reducers/config/networks/selectedNetwork';
|
||
|
|
||
|
const expectedState = {
|
||
|
initialState: 'ETH',
|
||
|
nodeChange: 'networkToChangeTo'
|
||
|
};
|
||
|
|
||
|
describe('selected network reducer', () => {
|
||
|
it('should return the initial state', () =>
|
||
|
expect(selectedNetwork(undefined, {} as any)).toEqual(expectedState.initialState));
|
||
|
it('should handle changing nodes by changing to the right network', () =>
|
||
|
expect(selectedNetwork(expectedState.initialState, actions.changeNode)).toEqual(
|
||
|
expectedState.nodeChange
|
||
|
));
|
||
|
});
|