Skip to content

Commit

Permalink
Improve pre-publish checks naming consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Dec 13, 2023
1 parent 3444583 commit 560ca68
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 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 @@ -10,7 +10,7 @@ import { toggleMoreMenu } from './toggle-more-menu';
export async function disablePrePublishChecks() {
await togglePreferencesOption(
'General',
'Enable pre-publish flow',
'Enable pre-publish checks',
false
);
await toggleMoreMenu( 'close' );
Expand Down
6 changes: 5 additions & 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,10 @@ import { toggleMoreMenu } from './toggle-more-menu';
* Enables Pre-publish checks.
*/
export async function enablePrePublishChecks() {
await togglePreferencesOption( 'General', 'Enable pre-publish flow', true );
await togglePreferencesOption(
'General',
'Enable pre-publish checks',
true
);
await toggleMoreMenu( 'close' );
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function EditPostPreferencesModal() {
help={ __(
'Review settings, such as visibility and tags.'
) }
label={ __( 'Enable pre-publish flow' ) }
label={ __( 'Enable pre-publish checks' ) }
/>
</PreferencesModalSection>
) }
Expand Down
8 changes: 4 additions & 4 deletions packages/edit-post/src/hooks/commands/use-common-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ export default function useCommonCommands() {
useCommand( {
name: 'core/toggle-publish-sidebar',
label: isPublishSidebarEnabled
? __( 'Disable pre-publish checklist' )
: __( 'Enable pre-publish checklist' ),
? __( 'Disable pre-publish checks' )
: __( 'Enable pre-publish checks' ),
icon: formatListBullets,
callback: ( { close } ) => {
close();
toggle( 'core/edit-post', 'isPublishSidebarEnabled' );
createInfoNotice(
isPublishSidebarEnabled
? __( 'Pre-publish checklist off.' )
: __( 'Pre-publish checklist on.' ),
? __( 'Pre-publish checks off.' )
: __( 'Pre-publish checks on.' ),
{
id: 'core/edit-post/publish-sidebar/notice',
type: 'snackbar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function MyEditorPreferencesModal() {
'Review settings, such as visibility and tags.'
) }
label={ __(
'Enable pre-publish flow'
'Enable pre-publish checks'
) }
/>
</PreferencesModalSection>
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/specs/editor/various/pref-modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.describe( 'Preferences modal', () => {
} );

test.describe( 'Preferences modal adaps to viewport', () => {
test( 'Enable pre-publish flow is visible on desktop ', async ( {
test( 'Enable pre-publish checks is visible on desktop ', async ( {
page,
} ) => {
await page.click(
Expand All @@ -18,14 +18,14 @@ test.describe( 'Preferences modal', () => {
await page.click( 'role=menuitem[name="Preferences"i]' );

const prePublishToggle = page.locator(
'role=checkbox[name="Enable pre-publish flow"i]'
'role=checkbox[name="Enable pre-publish checks"i]'
);

await expect( prePublishToggle ).toBeVisible();
} );
} );
test.describe( 'Preferences modal adaps to viewport', () => {
test( 'Enable pre-publish flow is not visible on mobile ', async ( {
test( 'Enable pre-publish checks is not visible on mobile ', async ( {
page,
} ) => {
await page.setViewportSize( { width: 500, height: 800 } );
Expand All @@ -44,7 +44,7 @@ test.describe( 'Preferences modal', () => {
);

const prePublishToggle = page.locator(
'role=checkbox[name="Enable pre-publish flow"i]'
'role=checkbox[name="Enable pre-publish checks"i]'
);

await expect( generalButton ).toBeVisible();
Expand Down

0 comments on commit 560ca68

Please sign in to comment.