diff --git a/scm-ui/src/config/modules/config.js b/scm-ui/src/config/modules/config.js index 062be6fc95..521dd94495 100644 --- a/scm-ui/src/config/modules/config.js +++ b/scm-ui/src/config/modules/config.js @@ -60,10 +60,8 @@ function reducer(state: any = {}, action: any = {}) { case FETCH_CONFIG_SUCCESS: return { ...state, - config: { - entries: action.payload, - configUpdatePermission: action.payload._links.update ? true : false - } + entries: action.payload, + configUpdatePermission: action.payload._links.update ? true : false }; default: return state; diff --git a/scm-ui/src/config/modules/config.test.js b/scm-ui/src/config/modules/config.test.js index 86b5db7cbf..837e7d126f 100644 --- a/scm-ui/src/config/modules/config.test.js +++ b/scm-ui/src/config/modules/config.test.js @@ -100,7 +100,7 @@ describe("config reducer", () => { it("should update state correctly according to FETCH_CONFIG_SUCCESS action", () => { const newState = reducer({}, fetchConfigSuccess(config)); - expect(newState.config).toEqual({ + expect(newState).toEqual({ entries: config, configUpdatePermission: true }); @@ -109,12 +109,12 @@ describe("config reducer", () => { it("should set configUpdatePermission to true if update link is present", () => { const newState = reducer({}, fetchConfigSuccess(config)); - expect(newState.config.configUpdatePermission).toBeTruthy(); + expect(newState.configUpdatePermission).toBeTruthy(); }); - it("should update state according to FETCH_GROUP_SUCCESS action", () => { + it("should update state according to FETCH_CONFIG_SUCCESS action", () => { const newState = reducer({}, fetchConfigSuccess(config)); - expect(newState.config.entries).toBe(config); + expect(newState.entries).toBe(config); }); });