1 import configureStore from 'redux-mock-store';
2 import thunk from 'redux-thunk';
5 getSetGlobalMessageEvent,
6 getClearGlobalMessageEvent
7 } from 'app/globalInlineMessageBar/GlobalInlineMessageBarActions.js';
9 globalInlineMessageBarActionTypes
10 } from 'app/globalInlineMessageBar/GlobalInlineMessageBarConstants.js';
13 } from 'utils/GlobalConstants.js'
15 describe('GlobalInlineMessageBarActionTests', () => {
16 it('getSetGlobalMessageEvent', () => {
17 const middlewares = [thunk];
18 const mockStore = configureStore(middlewares);
19 const store = mockStore({});
20 const msgText = 'some test msg';
21 store.dispatch(getSetGlobalMessageEvent(msgText, MESSAGE_LEVEL_WARNING));
22 const actions = store.getActions();
23 expect(actions).toEqual([{
24 type: globalInlineMessageBarActionTypes.SET_GLOBAL_MESSAGE,
27 msgSeverity: MESSAGE_LEVEL_WARNING
32 it('getClearGlobalMessageEvent', () => {
33 const middlewares = [thunk];
34 const mockStore = configureStore(middlewares);
35 const store = mockStore({});
36 store.dispatch(getClearGlobalMessageEvent());
37 const actions = store.getActions();
38 expect(actions).toEqual([{
39 type: globalInlineMessageBarActionTypes.CLEAR_GLOBAL_MESSAGE