From b7006b61fd5d04f3ca34028b4c51eb960c75efba Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Mon, 21 May 2018 13:52:38 -0700 Subject: [PATCH] Restore Post Formats UI by fixing editorSettings variable reference --- editor/components/post-format/check.js | 9 ++++++--- test/e2e/specs/hello.test.js | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/editor/components/post-format/check.js b/editor/components/post-format/check.js index 7c5ac5a4f77a7..cd124553a7cf1 100644 --- a/editor/components/post-format/check.js +++ b/editor/components/post-format/check.js @@ -14,8 +14,11 @@ function PostFormatCheck( { disablePostFormats, ...props } ) { } export default withSelect( - ( select ) => ( { - disablePostFormats: select( 'core/editor' ).getEditorSettings(), - } ) + ( select ) => { + const editorSettings = select( 'core/editor' ).getEditorSettings(); + return { + disablePostFormats: editorSettings.disablePostFormats, + }; + } )( PostFormatCheck ); diff --git a/test/e2e/specs/hello.test.js b/test/e2e/specs/hello.test.js index 82ead6a5408a5..8a05521b91a3e 100644 --- a/test/e2e/specs/hello.test.js +++ b/test/e2e/specs/hello.test.js @@ -12,10 +12,15 @@ describe( 'hello', () => { it( 'Should show the New Post Page in Gutenberg', async () => { expect( page.url() ).toEqual( expect.stringContaining( 'post-new.php' ) ); + // Should display the title. const title = await page.$( '[placeholder="Add title"]' ); expect( title ).not.toBeNull(); + // Should display the Preview button. const postPreviewButton = await page.$( '.editor-post-preview.components-button' ); expect( postPreviewButton ).not.toBeNull(); + // Should display the Post Formats UI. + const postFormatsUi = await page.$( '.editor-post-format' ); + expect( postFormatsUi ).not.toBeNull(); } ); it( 'Should have no history', async () => {