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

28 lines
1.1 KiB
TypeScript

import { mockActionsData } from '../shared/test-helpers/test-data';
import { UI_MESSAGES } from '../shared/services/consts-enums-functions';
import { initRootState } from './rtl.state';
import { RootReducer } from './rtl.reducers';
import { setSelectedNode } 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 SetSelectedNode', () => {
it('should set selected node', () => {
const SetSelectedNodeAction = setSelectedNode({ payload: { uiMessage: UI_MESSAGES.NO_SPINNER, prevLnNodeIndex: -1, currentLnNode: mockActionsData.setSelectedNode, isInitialSetup: false } });
const newState = RootReducer(initRootState, SetSelectedNodeAction);
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');
});
});
});