From e03b68cc5c35c0666281ad7f7dc6474495833e6e Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 28 Mar 2024 22:56:12 -0400 Subject: [PATCH] Update "Actions" string to "Options" in List View (#60136) * Update "Actions" to "Options" * Fix tests Co-authored-by: richtabor Co-authored-by: jasmussen --- .../src/components/list-view/block.js | 2 +- .../editor/blocks/navigation-list-view.spec.js | 18 +++++++++--------- .../editor/various/block-renaming.spec.js | 12 ++++++------ .../e2e/specs/editor/various/list-view.spec.js | 16 ++++++++-------- .../site-editor/navigation-editor.spec.js | 4 ++-- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/block-editor/src/components/list-view/block.js b/packages/block-editor/src/components/list-view/block.js index bc21e40d7e8d8..930d0a0f80ef6 100644 --- a/packages/block-editor/src/components/list-view/block.js +++ b/packages/block-editor/src/components/list-view/block.js @@ -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. } } diff --git a/test/e2e/specs/editor/blocks/navigation-list-view.spec.js b/test/e2e/specs/editor/blocks/navigation-list-view.spec.js index 44ca4ff4d079a..e4ceed785f7f4 100644 --- a/test/e2e/specs/editor/blocks/navigation-list-view.spec.js +++ b/test/e2e/specs/editor/blocks/navigation-list-view.spec.js @@ -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', @@ -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', @@ -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', diff --git a/test/e2e/specs/editor/various/block-renaming.spec.js b/test/e2e/specs/editor/various/block-renaming.spec.js index 0411d196fea4a..1799740fb1482 100644 --- a/test/e2e/specs/editor/various/block-renaming.spec.js +++ b/test/e2e/specs/editor/various/block-renaming.spec.js @@ -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', @@ -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', diff --git a/test/e2e/specs/editor/various/list-view.spec.js b/test/e2e/specs/editor/various/list-view.spec.js index 2d3abdf77a7eb..5a3ffbc8a3c96 100644 --- a/test/e2e/specs/editor/various/list-view.spec.js +++ b/test/e2e/specs/editor/various/list-view.spec.js @@ -308,7 +308,7 @@ test.describe( 'List View', () => { imageItem .locator( '..' ) // parent selector. .getByRole( 'button', { - name: 'Actions', + name: 'Options', } ) ).toBeFocused(); @@ -323,7 +323,7 @@ test.describe( 'List View', () => { groupItem .locator( '..' ) // parent selector. .getByRole( 'button', { - name: 'Actions', + name: 'Options', } ) ).toBeFocused(); } ); @@ -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 @@ -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 @@ -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, diff --git a/test/e2e/specs/site-editor/navigation-editor.spec.js b/test/e2e/specs/site-editor/navigation-editor.spec.js index 5cb3560149381..47519dc3ba613 100644 --- a/test/e2e/specs/site-editor/navigation-editor.spec.js +++ b/test/e2e/specs/site-editor/navigation-editor.spec.js @@ -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();