summaryrefslogtreecommitdiffstats
path: root/test/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js
diff options
context:
space:
mode:
authorSteven Thomas <steve.thomas@amdocs.com>2018-09-13 16:22:40 -0400
committerSteven Thomas <steve.thomas@amdocs.com>2018-09-13 16:23:05 -0400
commit96319fec0d2af2be5802a56d6b05a3ada939c8df (patch)
tree630e87f62fbbebcded761bf3e67d0f3eb5b78598 /test/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js
parentd1975c8134f0401b0ccebf3719eda129d53dac14 (diff)
increasing test coverage to 20 percent
Issue-ID: AAI-1599 Change-Id: I345e38d4319e52b56de0a33d7065e02617cc2103 Signed-off-by: Steven Thomas <steve.thomas@amdocs.com>
Diffstat (limited to 'test/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js')
-rw-r--r--test/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js b/test/globalInlineMessageBar/GlobalInlineMessageBarReducer.test.js
new file mode 100644
index 0000000..62389b4
--- /dev/null
+++ b/test/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: ''
+ });
+ });
+})