Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update push changes to global styles label text to "apply globally" #46965

Merged
merged 6 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function PushChangesToGlobalStylesControl( {
createSuccessNotice(
sprintf(
// translators: %s: Title of the block e.g. 'Heading'.
__( 'Pushed styles to all %s blocks.' ),
__( '%s styles applied.' ),
getBlockType( name ).title
),
{
Expand All @@ -124,7 +124,7 @@ function PushChangesToGlobalStylesControl( {
help={ sprintf(
// translators: %s: Title of the block e.g. 'Heading'.
__(
'Move this block’s typography, spacing, dimensions, and color styles to all %s blocks.'
'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'
),
getBlockType( name ).title
) }
Expand All @@ -137,7 +137,7 @@ function PushChangesToGlobalStylesControl( {
disabled={ changes.length === 0 }
onClick={ pushChanges }
>
{ __( 'Push changes to Global Styles' ) }
{ __( 'Apply globally' ) }
Copy link
Member

@juanfra juanfra Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great!

We may also want to update the description (line 127) as discussed here

</Button>
</BaseControl>
);
Expand Down
12 changes: 5 additions & 7 deletions test/e2e/specs/site-editor/push-to-global-styles.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.describe( 'Push to Global Styles button', () => {
// Push button should be disabled
await expect(
page.getByRole( 'button', {
name: 'Push changes to Global Styles',
name: 'Apply globally',
} )
).toBeDisabled();

Expand All @@ -69,27 +69,25 @@ test.describe( 'Push to Global Styles button', () => {
// Push button should now be enabled
await expect(
page.getByRole( 'button', {
name: 'Push changes to Global Styles',
name: 'Apply globally',
} )
).toBeEnabled();

// Press the Push button
await page
.getByRole( 'button', { name: 'Push changes to Global Styles' } )
.click();
await page.getByRole( 'button', { name: 'Apply globally' } ).click();

// Snackbar notification should appear
await expect(
page.getByRole( 'button', {
name: 'Dismiss this notice',
text: 'Pushed styles to all Heading blocks.',
text: 'Heading styles updated.',
} )
).toBeVisible();

// Push button should be disabled again
await expect(
page.getByRole( 'button', {
name: 'Push changes to Global Styles',
name: 'Apply globally',
} )
).toBeDisabled();

Expand Down