Skip to content

Commit

Permalink
Use "Save" instead of "Apply" in Link Control (#50964)
Browse files Browse the repository at this point in the history
* Update word and related tests

* Fix unit test for Media flow

* Change submit text for Image block replace flow
  • Loading branch information
getdave authored May 26, 2023
1 parent 4112155 commit 156ac69
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/link-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function LinkControl( {
! valueHasChanges || currentInputIsEmpty
}
>
{ __( 'Apply' ) }
{ __( 'Save' ) }
</Button>
<Button variant="tertiary" onClick={ handleCancel }>
{ __( 'Cancel' ) }
Expand Down
12 changes: 6 additions & 6 deletions packages/block-editor/src/components/link-control/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ describe( 'Manual link entry', () => {
} );

let submitButton = screen.getByRole( 'button', {
name: 'Apply',
name: 'Save',
} );

expect( submitButton ).toBeDisabled();
Expand All @@ -673,7 +673,7 @@ describe( 'Manual link entry', () => {
await user.keyboard( '[Enter]' );

submitButton = screen.getByRole( 'button', {
name: 'Apply',
name: 'Save',
} );

// Verify the UI hasn't allowed submission.
Expand All @@ -696,7 +696,7 @@ describe( 'Manual link entry', () => {
} );

let submitButton = screen.queryByRole( 'button', {
name: 'Apply',
name: 'Save',
} );

expect( submitButton ).toBeDisabled();
Expand All @@ -715,7 +715,7 @@ describe( 'Manual link entry', () => {
await user.click( submitButton );

submitButton = screen.queryByRole( 'button', {
name: 'Apply',
name: 'Save',
} );

// Verify the UI hasn't allowed submission.
Expand Down Expand Up @@ -1809,7 +1809,7 @@ describe( 'Addition Settings UI', () => {

// check that the "Apply" button is disabled by default.
const submitButton = screen.queryByRole( 'button', {
name: 'Apply',
name: 'Save',
} );

expect( submitButton ).toBeDisabled();
Expand Down Expand Up @@ -2242,7 +2242,7 @@ describe( 'Controlling link title text', () => {
expect( textInput ).toHaveValue( textValue );

const submitButton = screen.queryByRole( 'button', {
name: 'Apply',
name: 'Save',
} );

await user.click( submitButton );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe( 'General media replace flow', () => {

await user.click(
screen.getByRole( 'button', {
name: 'Apply',
name: 'Save',
} )
);

Expand Down
8 changes: 4 additions & 4 deletions test/e2e/specs/editor/blocks/image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ test.describe( 'Image', () => {

// Wait for the cropping tools to disappear.
await expect(
page.locator( 'role=button[name="Apply"i]' )
page.locator( 'role=button[name="Save"i]' )
).toBeHidden();

// Assert that the image is edited.
Expand Down Expand Up @@ -396,7 +396,7 @@ test.describe( 'Image', () => {

// Wait for the cropping tools to disappear.
await expect(
page.locator( 'role=button[name="Apply"i]' )
page.locator( 'role=button[name="Save"i]' )
).toBeHidden();

// Assert that the image is edited.
Expand Down Expand Up @@ -441,7 +441,7 @@ test.describe( 'Image', () => {

// Wait for the cropping tools to disappear.
await expect(
page.locator( 'role=button[name="Apply"i]' )
page.locator( 'role=button[name="Save"i]' )
).toBeHidden();

// Assert that the image is edited.
Expand Down Expand Up @@ -498,7 +498,7 @@ test.describe( 'Image', () => {
await page.click( 'role=button[name="Edit"i]' );
// Replace the url.
await page.fill( 'role=combobox[name="URL"i]', imageUrl );
await page.click( 'role=button[name="Apply"i]' );
await page.click( 'role=button[name="Save"i]' );

const regex = new RegExp(
`<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
Expand Down

1 comment on commit 156ac69

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 156ac69.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5090722619
📝 Reported issues:

Please sign in to comment.