Skip to content

Commit

Permalink
Update test for isPublishSidebarEnable preference
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Sep 11, 2018
1 parent 088d5c6 commit 5869239
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions edit-post/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe( 'state', () => {
expect( state ).toEqual( {
editorMode: 'visual',
isGeneralSidebarDismissed: false,
isPublishSidebarEnabled: true,
panels: { 'post-status': true },
features: { fixedToolbar: false },
pinnedPluginItems: {},
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 5869239

Please sign in to comment.