Skip to content
Snippets Groups Projects
Unverified Commit 53983922 authored by Nick Fitzpatrick's avatar Nick Fitzpatrick Committed by GitHub
Browse files

Closing all Dashboard sidebars when entering/exiting edit mode (#24067)

* Closing all Dashboard sidebars when entering/exiting edit mode

* fixing unit test
parent 2ad4a549
Branches
Tags
No related merge requests found
......@@ -379,8 +379,7 @@ const sidebar = handleActions(
next: () => DEFAULT_SIDEBAR,
},
[SET_EDITING_DASHBOARD]: {
next: (state, { payload: isEditing }) =>
isEditing ? state : DEFAULT_SIDEBAR,
next: () => DEFAULT_SIDEBAR,
},
[REMOVE_PARAMETER]: {
next: () => DEFAULT_SIDEBAR,
......
......@@ -97,7 +97,7 @@ describe("dashboard reducers", () => {
});
describe("SET_EDITING_DASHBOARD", () => {
it("should preserve sidebar state if payload is true to signify the entering of dashboard edit mode", () => {
it("should clear sideabr state when entering edit mode", () => {
const state = {
...initState,
sidebar: { name: "foo", props: { abc: 123 } },
......@@ -107,7 +107,7 @@ describe("dashboard reducers", () => {
type: SET_EDITING_DASHBOARD,
payload: true,
}),
).toEqual({ ...state, isEditing: true });
).toEqual({ ...state, isEditing: true, sidebar: { props: {} } });
});
it("should clear sideabr state when leaving edit mode", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment