summaryrefslogtreecommitdiffstats
path: root/test/configurableViews/ConfigurableViewReducer.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/configurableViews/ConfigurableViewReducer.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/configurableViews/ConfigurableViewReducer.test.js')
-rw-r--r--test/configurableViews/ConfigurableViewReducer.test.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/configurableViews/ConfigurableViewReducer.test.js b/test/configurableViews/ConfigurableViewReducer.test.js
new file mode 100644
index 0000000..0c5c46e
--- /dev/null
+++ b/test/configurableViews/ConfigurableViewReducer.test.js
@@ -0,0 +1,54 @@
+import {
+ configurableViewsActionTypes
+} from 'app/configurableViews/ConfigurableViewConstants.js';
+import ConfigurableViewReducer from 'app/configurableViews/ConfigurableViewReducer.js'
+describe('ConfigurableViewsReducerTests', () => {
+ it('Action Type: CONFIGURABLE_VIEWS_CONFIG_RECEIVED', () => {
+ const data = {
+ viewId: 'someViewId',
+ viewName: 'Some View Name',
+ viewRoute: 'some/view/route'
+ };
+ const action = {
+ type: configurableViewsActionTypes.CONFIGURABLE_VIEWS_CONFIG_RECEIVED,
+ data: data
+ };
+ let state = {};
+ state = ConfigurableViewReducer(state, action);
+ expect(state).toEqual({
+ configurableViewsConfig: data
+ });
+ });
+
+ it('Action Type: CUSTOM_COMPONENTS_RECEIVED', () => {
+ const data = {
+ componentName: 'someComponentName',
+ componentData: {
+ blah: 'blah',
+ filler: 'filler'
+ }
+ };
+ const action = {
+ type: configurableViewsActionTypes.CUSTOM_COMPONENTS_RECEIVED,
+ data: data
+ };
+ let state = {};
+ state = ConfigurableViewReducer(state, action);
+ expect(state).toEqual({
+ customComponents: data
+ });
+ });
+
+ it('Action Type: CUSTOM_ROUTES', () => {
+ const data = 'some/custom/route';
+ const action = {
+ type: configurableViewsActionTypes.CUSTOM_ROUTES,
+ data: data
+ };
+ let state = {};
+ state = ConfigurableViewReducer(state, action);
+ expect(state).toEqual({
+ customRoutes: data
+ });
+ });
+})