diff --git a/edit-post/store/test/reducer.js b/edit-post/store/test/reducer.js index eefd38bd2a94cc..415d2c6a7957e9 100644 --- a/edit-post/store/test/reducer.js +++ b/edit-post/store/test/reducer.js @@ -23,6 +23,7 @@ describe( 'state', () => { expect( state ).toEqual( { editorMode: 'visual', isGeneralSidebarDismissed: false, + isPublishSidebarEnabled: true, panels: { 'post-status': true }, features: { fixedToolbar: false }, pinnedPluginItems: {}, @@ -51,6 +52,24 @@ describe( 'state', () => { expect( state.isGeneralSidebarDismissed ).toBe( true ); } ); + it( 'should disable the publish sidebar', () => { + const original = deepFreeze( preferences( undefined, { } ) ); + const state = preferences( original, { + type: 'DISABLE_PUBLISH_SIDEBAR', + } ); + + expect( state.isPublishSidebarEnabled ).toBe( false ); + } ); + + it( 'should enable the publish sidebar', () => { + const original = deepFreeze( preferences( { isPublishSidebarEnabled: false }, { } ) ); + const state = preferences( original, { + type: 'ENABLE_PUBLISH_SIDEBAR', + } ); + + expect( state.isPublishSidebarEnabled ).toBe( true ); + } ); + it( 'should set the sidebar panel open flag to true if unset', () => { const state = preferences( deepFreeze( { panels: {} } ), { type: 'TOGGLE_GENERAL_SIDEBAR_EDITOR_PANEL',