From 5869239b54301c54ab42f93ec6dc98ed80a6eae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Tue, 11 Sep 2018 12:01:57 +0200 Subject: [PATCH] Update test for isPublishSidebarEnable preference --- edit-post/store/test/reducer.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/edit-post/store/test/reducer.js b/edit-post/store/test/reducer.js index eefd38bd2a94c..415d2c6a7957e 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',