Add test covering default route for ConfigurableViewReducer
Change-Id: I5ef339a214a1f0b75b81eb5e103c72174eb298f4
Issue-ID: AAI-1618
Signed-off-by: awudzins <adam.wudzinski@nokia.com>
import ConfigurableViewReducer from 'app/configurableViews/ConfigurableViewReducer.js'
describe('ConfigurableViewsReducerTests', () => {
it('Action Type: CONFIGURABLE_VIEWS_CONFIG_RECEIVED', () => {
import ConfigurableViewReducer from 'app/configurableViews/ConfigurableViewReducer.js'
describe('ConfigurableViewsReducerTests', () => {
it('Action Type: CONFIGURABLE_VIEWS_CONFIG_RECEIVED', () => {
const data = {
viewId: 'someViewId',
viewName: 'Some View Name',
const data = {
viewId: 'someViewId',
viewName: 'Some View Name',
data: data
};
let state = {};
data: data
};
let state = {};
state = ConfigurableViewReducer(state, action);
state = ConfigurableViewReducer(state, action);
expect(state).toEqual({
configurableViewsConfig: data
});
});
it('Action Type: CUSTOM_COMPONENTS_RECEIVED', () => {
expect(state).toEqual({
configurableViewsConfig: data
});
});
it('Action Type: CUSTOM_COMPONENTS_RECEIVED', () => {
const data = {
componentName: 'someComponentName',
componentData: {
const data = {
componentName: 'someComponentName',
componentData: {
data: data
};
let state = {};
data: data
};
let state = {};
state = ConfigurableViewReducer(state, action);
state = ConfigurableViewReducer(state, action);
expect(state).toEqual({
customComponents: data
});
});
it('Action Type: CUSTOM_ROUTES', () => {
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 = {};
const data = 'some/custom/route';
const action = {
type: configurableViewsActionTypes.CUSTOM_ROUTES,
data: data
};
let state = {};
state = ConfigurableViewReducer(state, action);
state = ConfigurableViewReducer(state, action);
expect(state).toEqual({
customRoutes: data
});
});
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);
+ });
+});