Skip to content

Commit

Permalink
Use testid for the expander element
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Feb 21, 2023
1 parent 594638a commit 4b80291
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/block-editor/src/components/list-view/expander.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ListViewExpander( { onClick } ) {
className="block-editor-list-view__expander"
onClick={ ( event ) => onClick( event, { forceToggle: true } ) }
aria-hidden="true"
data-testid="list-view-expander"
>
<Icon icon={ isRTL() ? chevronLeftSmall : chevronRightSmall } />
</span>
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ test.describe( 'List View', () => {
// Collapse the Cover block.
await listView
.getByRole( 'gridcell', { name: 'Cover link' } )
.locator( '.block-editor-list-view__expander[aria-hidden="true"]' )
.getByTestId( 'list-view-expander', { includeHidden: true } )
// Force the click to bypass the visibility check. The expander is
// intentionally aria-hidden. See the implementation for details.
.click( { force: true } );
Expand Down

0 comments on commit 4b80291

Please sign in to comment.