You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RTL/src/app/store/rtl.reducers.spec.ts

27 lines
1011 B
TypeScript

import { mockActionsData } from '../shared/test-helpers/test-data';
import { initRootState } from './rtl.state';
import { RootReducer } from './rtl.reducers';
import { resetRootStore } from './rtl.actions';
describe('RTL reducer', () => {
describe('default action', () => {
it('should return initial state', () => {
const newState = RootReducer(initRootState, { type: 'VOID' });
expect(newState).toEqual(initRootState);
});
});
describe('Action Reset Root Store', () => {
it('should reset root store with new setup', () => {
const ResetRootStoreAction = resetRootStore({ payload: mockActionsData.setSelectedNode });
const newState = RootReducer(initRootState, ResetRootStoreAction);
expect(newState.selNode.settings.themeMode).toBe('NIGHT');
expect(newState.selNode.settings.themeColor).toBe('TEAL');
expect(newState.selNode.settings.userPersona).toBe('MERCHANT');
expect(newState.selNode.lnImplementation).toEqual('LND');
});
});
});