Skip to content

Commit

Permalink
More sentence case fixes for labels, etc. (#19377)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and mkaz committed Jan 4, 2020
1 parent d502949 commit 7a0e48c
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/e2e-test-utils/src/disable-pre-publish-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 1 addition & 1 deletion packages/e2e-test-utils/src/enable-pre-publish-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/specs/editor/various/preview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
10 changes: 5 additions & 5 deletions packages/edit-post/src/components/options-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export function OptionsModal( { isModalActive, isViewable, closeModal } ) {
onRequestClose={ closeModal }
>
<Section title={ __( 'General' ) }>
<EnablePublishSidebarOption label={ __( 'Pre-publish Checks' ) } />
<EnableFeature feature="showInserterHelpPanel" label={ __( 'Inserter Help Panel' ) } />
<EnablePublishSidebarOption label={ __( 'Pre-publish checks' ) } />
<EnableFeature feature="showInserterHelpPanel" label={ __( 'Inserter help panel' ) } />
</Section>
<Section title={ __( 'Document Panels' ) }>
<Section title={ __( 'Document panels' ) }>
<EnablePluginDocumentSettingPanelOption.Slot />
{ isViewable && (
<EnablePanelOption label={ __( 'Permalink' ) } panelName="post-link" />
Expand All @@ -71,10 +71,10 @@ export function OptionsModal( { isModalActive, isViewable, closeModal } ) {
<EnablePanelOption label={ __( 'Discussion' ) } panelName="discussion-panel" />
</PostTypeSupportCheck>
<PageAttributesCheck>
<EnablePanelOption label={ __( 'Page Attributes' ) } panelName="page-attributes" />
<EnablePanelOption label={ __( 'Page attributes' ) } panelName="page-attributes" />
</PageAttributesCheck>
</Section>
<MetaBoxesSection title={ __( 'Advanced Panels' ) } />
<MetaBoxesSection title={ __( 'Advanced panels' ) } />
</Modal>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function MetaBoxesSection( { areCustomFieldsRegistered, metaBoxes, ...sec

return (
<Section { ...sectionProps }>
{ areCustomFieldsRegistered && <EnableCustomFieldsOption label={ __( 'Custom Fields' ) } /> }
{ areCustomFieldsRegistered && <EnableCustomFieldsOption label={ __( 'Custom fields' ) } /> }
{ map( thirdPartyMetaBoxes, ( { id, title } ) => (
<EnablePanelOption key={ id } label={ title } panelName={ `meta-box-${ id }` } />
) ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ exports[`OptionsModal should match snapshot when the modal is active 1`] = `
title="General"
>
<WithSelect(WithDispatch(IfViewportMatches(BaseOption)))
label="Pre-publish Checks"
label="Pre-publish checks"
/>
<WithSelect(WithDispatch(BaseOption))
feature="showInserterHelpPanel"
label="Inserter Help Panel"
label="Inserter help panel"
/>
</Section>
<Section
title="Document Panels"
title="Document panels"
>
<EnablePluginDocumentSettingPanelOptionSlot />
<WithSelect(PostTaxonomies)
Expand Down Expand Up @@ -51,13 +51,13 @@ exports[`OptionsModal should match snapshot when the modal is active 1`] = `
</WithSelect(PostTypeSupportCheck)>
<WithSelect(PageAttributesCheck)>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
label="Page Attributes"
label="Page attributes"
panelName="page-attributes"
/>
</WithSelect(PageAttributesCheck)>
</Section>
<WithSelect(MetaBoxesSection)
title="Advanced Panels"
title="Advanced panels"
/>
</WithInstanceId(Modal)>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
<Section
title="Advanced Panels"
title="Advanced panels"
>
<WithSelect(EnableCustomFieldsOption)
label="Custom Fields"
label="Custom fields"
/>
</Section>
`;

exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`] = `
<Section
title="Advanced Panels"
title="Advanced panels"
>
<WithSelect(EnableCustomFieldsOption)
label="Custom Fields"
label="Custom fields"
/>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
key="test1"
Expand All @@ -32,7 +32,7 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`

exports[`MetaBoxesSection renders meta box options 1`] = `
<Section
title="Advanced Panels"
title="Advanced panels"
>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
key="test1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe( 'MetaBoxesSection', () => {
it( 'renders a Custom Fields option', () => {
const wrapper = shallow(
<MetaBoxesSection
title="Advanced Panels"
title="Advanced panels"
areCustomFieldsRegistered
metaBoxes={ [ { id: 'postcustom', title: 'This should not render' } ] }
/>
Expand All @@ -33,7 +33,7 @@ describe( 'MetaBoxesSection', () => {
it( 'renders meta box options', () => {
const wrapper = shallow(
<MetaBoxesSection
title="Advanced Panels"
title="Advanced panels"
areCustomFieldsRegistered={ false }
metaBoxes={ [
{ id: 'postcustom', title: 'This should not render' },
Expand All @@ -48,7 +48,7 @@ describe( 'MetaBoxesSection', () => {
it( 'renders a Custom Fields option and meta box options', () => {
const wrapper = shallow(
<MetaBoxesSection
title="Advanced Panels"
title="Advanced panels"
areCustomFieldsRegistered
metaBoxes={ [
{ id: 'postcustom', title: 'This should not render' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function PageAttributes( { isEnabled, isOpened, onTogglePanel, postType }
return (
<PageAttributesCheck>
<PanelBody
title={ get( postType, [ 'labels', 'attributes' ], __( 'Page Attributes' ) ) }
title={ get( postType, [ 'labels', 'attributes' ], __( 'Page attributes' ) ) }
opened={ isOpened }
onToggle={ onTogglePanel }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function PostLink( {
</div>
) }
<p className="edit-post-post-link__preview-label">
{ postTypeLabel || __( 'View Post' ) }
{ postTypeLabel || __( 'View post' ) }
</p>
<div className="edit-post-post-link__preview-link-container">
<ExternalLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function PostPendingStatus( { status, onUpdateStatus } ) {
return (
<PostPendingStatusCheck>
<CheckboxControl
label={ __( 'Pending Review' ) }
label={ __( 'Pending review' ) }
checked={ status === 'pending' }
onChange={ togglePendingStatus }
/>
Expand Down

0 comments on commit 7a0e48c

Please sign in to comment.