summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Forsyth <jf2512@att.com>2019-08-15 13:55:13 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-15 13:55:13 +0000
commita2b37b8015cfaf44bf5714770ec8fb456424ec14 (patch)
treec4e3c2eedd0903eaec4134f4dcbff6fe948caf18 /test
parent85be10eac05a4d95b58f1afbca6d2018f91434c2 (diff)
parent117972dc1b72e33b15c4b1c04788bb46014d96c9 (diff)
Merge "ConfigurableViewReducer test"
Diffstat (limited to 'test')
-rw-r--r--test/app/configurableViews/ConfigurableViewReducer.test.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/test/app/configurableViews/ConfigurableViewReducer.test.js b/test/app/configurableViews/ConfigurableViewReducer.test.js
index 0c5c46e..53e8b89 100644
--- a/test/app/configurableViews/ConfigurableViewReducer.test.js
+++ b/test/app/configurableViews/ConfigurableViewReducer.test.js
@@ -4,6 +4,7 @@ import {
import ConfigurableViewReducer from 'app/configurableViews/ConfigurableViewReducer.js'
describe('ConfigurableViewsReducerTests', () => {
it('Action Type: CONFIGURABLE_VIEWS_CONFIG_RECEIVED', () => {
+ // Given
const data = {
viewId: 'someViewId',
viewName: 'Some View Name',
@@ -14,13 +15,18 @@ describe('ConfigurableViewsReducerTests', () => {
data: data
};
let state = {};
+
+ // When
state = ConfigurableViewReducer(state, action);
+
+ // Then
expect(state).toEqual({
configurableViewsConfig: data
});
});
it('Action Type: CUSTOM_COMPONENTS_RECEIVED', () => {
+ // Given
const data = {
componentName: 'someComponentName',
componentData: {
@@ -33,22 +39,46 @@ describe('ConfigurableViewsReducerTests', () => {
data: data
};
let state = {};
+
+ // When
state = ConfigurableViewReducer(state, action);
+
+ // Then
expect(state).toEqual({
customComponents: data
});
});
it('Action Type: CUSTOM_ROUTES', () => {
+ // Given
const data = 'some/custom/route';
const action = {
type: configurableViewsActionTypes.CUSTOM_ROUTES,
data: data
};
let state = {};
+
+ // When
state = ConfigurableViewReducer(state, action);
+
+ // Then
expect(state).toEqual({
customRoutes: data
});
});
-})
+
+ it('Action Type: unknown', () => {
+ // Given
+ const action = {
+ type: "TestUnknownType",
+ data: "TestData"
+ };
+ let state = {};
+
+ // When
+ state = ConfigurableViewReducer(state, action);
+
+ // Then
+ expect(state).toEqual(state);
+ });
+});