From 7a0e48c9158c4d7193a0274aa99ab039552fb1a2 Mon Sep 17 00:00:00 2001 From: Mark Uraine Date: Sat, 4 Jan 2020 13:41:36 -0500 Subject: [PATCH] More sentence case fixes for labels, etc. (#19377) * More sentence case fixes for labels, etc. * Fixing e2e tests to match changes. * Updated more e2e tests and some snapshots too. * Edit Post: Update Options Modal snapshot * E2E Tests: Revert "View Post" back to uppercase These labels are associated with the registered post type, defined in WordPress See: https://github.com/WordPress/WordPress/blob/08f53ef906049b61e9effcfc72d9b1906c8eb5ac/wp-includes/post.php#L1695-L1696 Co-authored-by: Andrew Duthie --- .../e2e-test-utils/src/disable-pre-publish-checks.js | 2 +- .../e2e-test-utils/src/enable-pre-publish-checks.js | 2 +- .../specs/editor/various/change-detection.test.js | 2 +- .../e2e-tests/specs/editor/various/preview.test.js | 2 +- .../edit-post/src/components/options-modal/index.js | 10 +++++----- .../src/components/options-modal/meta-boxes-section.js | 2 +- .../options-modal/test/__snapshots__/index.js.snap | 10 +++++----- .../test/__snapshots__/meta-boxes-section.js.snap | 10 +++++----- .../options-modal/test/meta-boxes-section.js | 6 +++--- .../src/components/sidebar/page-attributes/index.js | 2 +- .../src/components/sidebar/post-link/index.js | 2 +- .../editor/src/components/post-pending-status/index.js | 2 +- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/e2e-test-utils/src/disable-pre-publish-checks.js b/packages/e2e-test-utils/src/disable-pre-publish-checks.js index 099ad81959c748..8fcade56d79af4 100644 --- a/packages/e2e-test-utils/src/disable-pre-publish-checks.js +++ b/packages/e2e-test-utils/src/disable-pre-publish-checks.js @@ -8,6 +8,6 @@ import { toggleMoreMenu } from './toggle-more-menu'; * Disables Pre-publish checks. */ export async function disablePrePublishChecks() { - await toggleScreenOption( 'Pre-publish Checks', false ); + await toggleScreenOption( 'Pre-publish checks', false ); await toggleMoreMenu(); } diff --git a/packages/e2e-test-utils/src/enable-pre-publish-checks.js b/packages/e2e-test-utils/src/enable-pre-publish-checks.js index 0f68f9673acbb7..d12ccac70108c1 100644 --- a/packages/e2e-test-utils/src/enable-pre-publish-checks.js +++ b/packages/e2e-test-utils/src/enable-pre-publish-checks.js @@ -8,6 +8,6 @@ import { toggleMoreMenu } from './toggle-more-menu'; * Enables Pre-publish checks. */ export async function enablePrePublishChecks() { - await toggleScreenOption( 'Pre-publish Checks', true ); + await toggleScreenOption( 'Pre-publish checks', true ); await toggleMoreMenu(); } diff --git a/packages/e2e-tests/specs/editor/various/change-detection.test.js b/packages/e2e-tests/specs/editor/various/change-detection.test.js index 7add035fd79256..4f5cb5822fa7f8 100644 --- a/packages/e2e-tests/specs/editor/various/change-detection.test.js +++ b/packages/e2e-tests/specs/editor/various/change-detection.test.js @@ -96,7 +96,7 @@ describe( 'Change detection', () => { // Toggle post as needing review (not persisted for autosave). await ensureSidebarOpened(); - const postPendingReviewButton = ( await page.$x( "//label[contains(text(), 'Pending Review')]" ) )[ 0 ]; + const postPendingReviewButton = ( await page.$x( "//label[contains(text(), 'Pending review')]" ) )[ 0 ]; await postPendingReviewButton.click( 'button' ); // Force autosave to occur immediately. diff --git a/packages/e2e-tests/specs/editor/various/preview.test.js b/packages/e2e-tests/specs/editor/various/preview.test.js index db92a0ff26e8c2..7c9442f1e982b9 100644 --- a/packages/e2e-tests/specs/editor/various/preview.test.js +++ b/packages/e2e-tests/specs/editor/various/preview.test.js @@ -61,7 +61,7 @@ async function waitForPreviewNavigation( previewPage ) { * @param {boolean} shouldBeChecked If true, turns the option on. If false, off. */ async function toggleCustomFieldsOption( shouldBeChecked ) { - const checkboxXPath = '//*[contains(@class, "edit-post-options-modal")]//label[contains(text(), "Custom Fields")]'; + const checkboxXPath = '//*[contains(@class, "edit-post-options-modal")]//label[contains(text(), "Custom fields")]'; await clickOnMoreMenuItem( 'Options' ); await page.waitForXPath( checkboxXPath ); const [ checkboxHandle ] = await page.$x( checkboxXPath ); diff --git a/packages/edit-post/src/components/options-modal/index.js b/packages/edit-post/src/components/options-modal/index.js index 8f7e2029947701..bd5b83fb3f5290 100644 --- a/packages/edit-post/src/components/options-modal/index.js +++ b/packages/edit-post/src/components/options-modal/index.js @@ -45,10 +45,10 @@ export function OptionsModal( { isModalActive, isViewable, closeModal } ) { onRequestClose={ closeModal } >
- - + +
-
+
{ isViewable && ( @@ -71,10 +71,10 @@ export function OptionsModal( { isModalActive, isViewable, closeModal } ) { - +
- + ); } diff --git a/packages/edit-post/src/components/options-modal/meta-boxes-section.js b/packages/edit-post/src/components/options-modal/meta-boxes-section.js index e4ab459a0e41a3..0443c47ee55603 100644 --- a/packages/edit-post/src/components/options-modal/meta-boxes-section.js +++ b/packages/edit-post/src/components/options-modal/meta-boxes-section.js @@ -25,7 +25,7 @@ export function MetaBoxesSection( { areCustomFieldsRegistered, metaBoxes, ...sec return (
- { areCustomFieldsRegistered && } + { areCustomFieldsRegistered && } { map( thirdPartyMetaBoxes, ( { id, title } ) => ( ) ) } diff --git a/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap b/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap index a9a4f24bb901a8..be37c39470686f 100644 --- a/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap +++ b/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap @@ -10,15 +10,15 @@ exports[`OptionsModal should match snapshot when the modal is active 1`] = ` title="General" >
`; diff --git a/packages/edit-post/src/components/options-modal/test/__snapshots__/meta-boxes-section.js.snap b/packages/edit-post/src/components/options-modal/test/__snapshots__/meta-boxes-section.js.snap index b30ba56cfdb8f2..18cd57ad1252d8 100644 --- a/packages/edit-post/src/components/options-modal/test/__snapshots__/meta-boxes-section.js.snap +++ b/packages/edit-post/src/components/options-modal/test/__snapshots__/meta-boxes-section.js.snap @@ -2,20 +2,20 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
`; exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`] = `
{ it( 'renders a Custom Fields option', () => { const wrapper = shallow( @@ -33,7 +33,7 @@ describe( 'MetaBoxesSection', () => { it( 'renders meta box options', () => { const wrapper = shallow( { it( 'renders a Custom Fields option and meta box options', () => { const wrapper = shallow( diff --git a/packages/edit-post/src/components/sidebar/post-link/index.js b/packages/edit-post/src/components/sidebar/post-link/index.js index 18863fc518375e..4fdeb992241381 100644 --- a/packages/edit-post/src/components/sidebar/post-link/index.js +++ b/packages/edit-post/src/components/sidebar/post-link/index.js @@ -97,7 +97,7 @@ function PostLink( { ) }

- { postTypeLabel || __( 'View Post' ) } + { postTypeLabel || __( 'View post' ) }