Skip to content

Commit

Permalink
Update "Actions" string to "Options" in List View (WordPress#60136)
Browse files Browse the repository at this point in the history
* Update "Actions" to "Options"

* Fix tests

Co-authored-by: richtabor <[email protected]>
Co-authored-by: jasmussen <[email protected]>
  • Loading branch information
3 people authored Mar 29, 2024
1 parent 447e0b1 commit e03b68c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/list-view/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function ListViewBlock( {
clientIds={ dropdownClientIds }
block={ block }
icon={ moreVertical }
label={ __( 'Actions' ) }
label={ __( 'Options' ) }
popoverProps={ {
anchor: settingsPopoverAnchor, // Used to position the settings at the cursor on right-click.
} }
Expand Down
18 changes: 9 additions & 9 deletions test/e2e/specs/editor/blocks/navigation-list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,21 +266,21 @@ test.describe( 'Navigation block - List view editing', () => {
hasText: 'Block 2 of 2, Level 1.', // proxy for filtering by description.
} );

// The actions menu button is a sibling of the menu item gridcell.
// The options menu button is a sibling of the menu item gridcell.
const subMenuItemActions = subMenuItem
.locator( '..' ) // parent selector.
.getByRole( 'button', {
name: 'Actions',
name: 'Options',
} );

// Open the actions menu.
await subMenuItemActions.click();

// usage of `page` is required because the actions menu is rendered into a slot
// usage of `page` is required because the options menu is rendered into a slot
// outside of the treegrid.
const removeBlockAction = page
.getByRole( 'menu', {
name: 'Actions',
name: 'Options',
} )
.getByRole( 'menuitem', {
name: 'Remove Top Level Item 2',
Expand Down Expand Up @@ -401,7 +401,7 @@ test.describe( 'Navigation block - List view editing', () => {
description: 'Structure for navigation menu: Test Menu',
} );

// click on actions menu for the first menu item and select remove.
// click on options menu for the first menu item and select remove.
const firstMenuItem = listView
.getByRole( 'gridcell', {
name: 'Top Level Item 1',
Expand All @@ -410,22 +410,22 @@ test.describe( 'Navigation block - List view editing', () => {
hasText: 'Block 1 of 2, Level 1.', // proxy for filtering by description.
} );

// The actions menu button is a sibling of the menu item gridcell.
// The options menu button is a sibling of the menu item gridcell.
const firstItemActions = firstMenuItem
.locator( '..' ) // parent selector.
.getByRole( 'button', {
name: 'Actions',
name: 'Options',
} );

// Open the actions menu.
await firstItemActions.click();

// Add the submenu.
// usage of `page` is required because the actions menu is rendered into a slot
// usage of `page` is required because the options menu is rendered into a slot
// outside of the treegrid.
const addSubmenuAction = page
.getByRole( 'menu', {
name: 'Actions',
name: 'Options',
} )
.getByRole( 'menuitem', {
name: 'Add submenu',
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/specs/editor/various/block-renaming.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ test.describe( 'Block Renaming', () => {
await pageUtils.pressKeys( 'primary+a' );

const blockActionsTrigger = listView.getByRole( 'button', {
name: 'Actions',
name: 'Options',
} );

await blockActionsTrigger.click();

const renameMenuItem = page
.getByRole( 'menu', {
name: 'Actions',
name: 'Options',
} )
.getByRole( 'menuitem', {
name: 'Rename',
Expand Down Expand Up @@ -227,20 +227,20 @@ test.describe( 'Block Renaming', () => {
name: 'Heading',
} );

// The actions menu button is a sibling of the menu item gridcell.
// The options menu button is a sibling of the menu item gridcell.
const headingItemActions = headingItem
.locator( '..' ) // parent selector.
.getByRole( 'button', {
name: 'Actions',
name: 'Options',
} );

await headingItemActions.click();

// usage of `page` is required because the actions menu is rendered
// usage of `page` is required because the options menu is rendered
// into a slot outside of the treegrid.
const renameMenuItem = page
.getByRole( 'menu', {
name: 'Actions',
name: 'Options',
} )
.getByRole( 'menuitem', {
name: 'Rename',
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/specs/editor/various/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ test.describe( 'List View', () => {
imageItem
.locator( '..' ) // parent selector.
.getByRole( 'button', {
name: 'Actions',
name: 'Options',
} )
).toBeFocused();

Expand All @@ -323,7 +323,7 @@ test.describe( 'List View', () => {
groupItem
.locator( '..' ) // parent selector.
.getByRole( 'button', {
name: 'Actions',
name: 'Options',
} )
).toBeFocused();
} );
Expand Down Expand Up @@ -964,12 +964,12 @@ test.describe( 'List View', () => {
const listView = await listViewUtils.openListView();

await listView
.getByRole( 'button', { name: 'Actions' } )
.getByRole( 'button', { name: 'Options' } )
.first()
.click();

await page
.getByRole( 'menu', { name: 'Actions' } )
.getByRole( 'menu', { name: 'Options' } )
.getByRole( 'menuitem', { name: 'Duplicate' } )
.click();
await expect
Expand All @@ -985,11 +985,11 @@ test.describe( 'List View', () => {

await page.keyboard.press( 'Shift+ArrowUp' );
await listView
.getByRole( 'button', { name: 'Actions' } )
.getByRole( 'button', { name: 'Options' } )
.first()
.click();
await page
.getByRole( 'menu', { name: 'Actions' } )
.getByRole( 'menu', { name: 'Options' } )
.getByRole( 'menuitem', { name: 'Delete' } )
.click();
await expect
Expand All @@ -1007,9 +1007,9 @@ test.describe( 'List View', () => {
.filter( {
has: page.getByRole( 'gridcell', { name: 'File' } ),
} )
.getByRole( 'button', { name: 'Actions' } );
.getByRole( 'button', { name: 'Options' } );
const optionsForFileMenu = page.getByRole( 'menu', {
name: 'Actions',
name: 'Options',
} );
await expect(
optionsForFileToggle,
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/site-editor/navigation-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ test.describe( 'Editing Navigation Menus', () => {
listView.locator( `id=${ navBlockNodeDescriptionId }` )
).toHaveText( /This block is locked./ );

// The block should have no actions menu.
// The block should have no options menu.
await expect(
navBlockNode
.locator( '..' ) // parent selector.
.getByRole( 'button', {
name: 'Actions',
name: 'Options',
} )
).toBeHidden();

Expand Down

0 comments on commit e03b68c

Please sign in to comment.