diff options
author | James Forsyth <jf2512@att.com> | 2019-04-09 20:41:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-09 20:41:31 +0000 |
commit | cae868635ebe867b85223b056a5243c128192cbe (patch) | |
tree | 13db7f35d15a5463dfe3512e849ab4275a2ba346 /test/app/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js | |
parent | 5b062c1f5005e14b6f18563ee875a06f5c1bc299 (diff) | |
parent | b0f2f345cc2d1cc3812ad8a06fc1898daf5842d0 (diff) |
Merge "Remove unused code"
Diffstat (limited to 'test/app/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js')
-rw-r--r-- | test/app/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/app/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js b/test/app/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js new file mode 100644 index 0000000..62389b4 --- /dev/null +++ b/test/app/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js @@ -0,0 +1,40 @@ +import GlobalInlineMessageBarReducer from 'app/globalInlineMessageBar/GlobalInlineMessageBarReducer.js'; +import { + globalInlineMessageBarActionTypes +} from 'app/globalInlineMessageBar/GlobalInlineMessageBarConstants.js'; +import { + MESSAGE_LEVEL_WARNING +} from 'utils/GlobalConstants.js' + +describe('GlobalInlineMessageBarReducerTests', () => { + it('Action Type: SET_GLOBAL_MESSAGE', () => { + const action = { + type: globalInlineMessageBarActionTypes.SET_GLOBAL_MESSAGE, + data: { + msgText: 'some error message here', + msgSeverity: MESSAGE_LEVEL_WARNING + } + }; + let state = {}; + state = GlobalInlineMessageBarReducer(state, action); + expect(state).toEqual({ + feedbackMsgText: action.data.msgText, + feedbackMsgSeverity: action.data.msgSeverity + }); + }); + + it('Action Type: CLEAR_GLOBAL_MESSAGE', () => { + const action = { + type: globalInlineMessageBarActionTypes.CLEAR_GLOBAL_MESSAGE + }; + let state = { + feedbackMsgText: 'some error message here', + feedbackMsgSeverity: MESSAGE_LEVEL_WARNING + }; + state = GlobalInlineMessageBarReducer(state, action); + expect(state).toEqual({ + feedbackMsgText: '', + feedbackMsgSeverity: '' + }); + }); +}) |