Skip to content

Commit

Permalink
Image: Mark connected controls as 'readyonly' (#59059)
Browse files Browse the repository at this point in the history
* Image: Mark connected controls as 'readyonly'
* Update e2e tests

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: michalczaplinski <czapla@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>
  • Loading branch information
4 people authored Feb 15, 2024
1 parent 888c78e commit d3ab97b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export default function Image( {
label={ __( 'Alternative text' ) }
value={ alt || '' }
onChange={ updateAlt }
disabled={ lockAltControls }
readOnly={ lockAltControls }
help={
lockAltControls ? (
<>
Expand Down Expand Up @@ -575,7 +575,7 @@ export default function Image( {
label={ __( 'Title attribute' ) }
value={ title || '' }
onChange={ onSetTitle }
disabled={ lockTitleControls }
readOnly={ lockTitleControls }
help={
lockTitleControls ? (
<>{ __( 'Connected to a custom field' ) }</>
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/specs/editor/various/block-bindings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down Expand Up @@ -939,7 +939,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down Expand Up @@ -1018,7 +1018,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const titleValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
Expand Down Expand Up @@ -1081,7 +1081,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const titleValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
Expand Down Expand Up @@ -1137,7 +1137,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down Expand Up @@ -1545,7 +1545,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down Expand Up @@ -1621,7 +1621,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const titleValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
Expand Down Expand Up @@ -1691,7 +1691,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down

1 comment on commit d3ab97b

@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 d3ab97b.
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/7917357145
📝 Reported issues:

Please sign in to comment.