From 8009caae87e99eb3ba567fadbe2350b5eaeb16e0 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Mon, 11 Mar 2024 16:07:16 +0100 Subject: [PATCH] Add tooltip to several Back buttons. --- .../inserter/mobile-tab-navigation.js | 2 +- packages/e2e-test-utils/src/site-editor.js | 2 +- .../font-library-modal/font-collection.js | 2 +- .../font-library-modal/installed-fonts.js | 2 +- .../src/components/global-styles/header.js | 2 +- .../preferences-modal-tabs/index.js | 4 +--- test/e2e/specs/site-editor/style-book.spec.js | 6 +++--- .../site-editor/style-variations.spec.js | 20 +++++-------------- .../user-global-styles-revisions.spec.js | 2 +- 9 files changed, 15 insertions(+), 27 deletions(-) diff --git a/packages/block-editor/src/components/inserter/mobile-tab-navigation.js b/packages/block-editor/src/components/inserter/mobile-tab-navigation.js index 0efc739fac6571..fa8191cc5eaaa0 100644 --- a/packages/block-editor/src/components/inserter/mobile-tab-navigation.js +++ b/packages/block-editor/src/components/inserter/mobile-tab-navigation.js @@ -32,7 +32,7 @@ function ScreenHeader( { title } ) { } icon={ isRTL() ? chevronRight : chevronLeft } size="small" - aria-label={ __( 'Navigate to the previous view' ) } + label={ __( 'Back' ) } /> { title } diff --git a/packages/e2e-test-utils/src/site-editor.js b/packages/e2e-test-utils/src/site-editor.js index 02c3d05f74cc16..4f6cf1773134fb 100644 --- a/packages/e2e-test-utils/src/site-editor.js +++ b/packages/e2e-test-utils/src/site-editor.js @@ -117,7 +117,7 @@ export async function openGlobalStylesPanel( panelName ) { */ export async function openPreviousGlobalStylesPanel() { await page.click( - 'div[aria-label="Editor settings"] button[aria-label="Navigate to the previous view"]' + 'div[aria-label="Editor settings"] button[aria-label="Back"]' ); } diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js index 81198cdbd05424..bc8d99091ad7f9 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js @@ -345,7 +345,7 @@ function FontCollection( { slug } ) { onClick={ () => { setSelectedFont( null ); } } - aria-label={ __( 'Navigate to the previous view' ) } + label={ __( 'Back' ) } /> { handleSetLibraryFontSelected( null ); } } - aria-label={ __( 'Navigate to the previous view' ) } + label={ __( 'Back' ) } /> diff --git a/packages/preferences/src/components/preferences-modal-tabs/index.js b/packages/preferences/src/components/preferences-modal-tabs/index.js index f48d715dc1bf8a..f70430367cc617 100644 --- a/packages/preferences/src/components/preferences-modal-tabs/index.js +++ b/packages/preferences/src/components/preferences-modal-tabs/index.js @@ -157,9 +157,7 @@ export default function PreferencesModalTabs( { sections } ) { ? chevronRight : chevronLeft } - aria-label={ __( - 'Navigate to the previous view' - ) } + label={ __( 'Back' ) } /> { section.tabLabel } diff --git a/test/e2e/specs/site-editor/style-book.spec.js b/test/e2e/specs/site-editor/style-book.spec.js index a832e06f6a6391..e06f90f0cf9859 100644 --- a/test/e2e/specs/site-editor/style-book.spec.js +++ b/test/e2e/specs/site-editor/style-book.spec.js @@ -116,8 +116,8 @@ test.describe( 'Style Book', () => { } ) .click(); - await page.click( 'role=button[name="Navigate to the previous view"]' ); - await page.click( 'role=button[name="Navigate to the previous view"]' ); + await page.click( 'role=button[name="Back"]' ); + await page.click( 'role=button[name="Back"]' ); await expect( page.locator( 'role=button[name="Blocks styles"]' ) @@ -172,7 +172,7 @@ test.describe( 'Style Book', () => { 'style book should be visible' ).toBeVisible(); - await page.click( 'role=button[name="Navigate to the previous view"]' ); + await page.click( 'role=button[name="Back"]' ); await page .getByRole( 'region', { name: 'Editor settings' } ) diff --git a/test/e2e/specs/site-editor/style-variations.spec.js b/test/e2e/specs/site-editor/style-variations.spec.js index 8868c733006687..9b12f37c0baa6b 100644 --- a/test/e2e/specs/site-editor/style-variations.spec.js +++ b/test/e2e/specs/site-editor/style-variations.spec.js @@ -79,9 +79,7 @@ test.describe( 'Global styles variations', () => { await editor.canvas.locator( 'body' ).click(); await siteEditorStyleVariations.browseStyles(); await page.click( 'role=button[name="pink"i]' ); - await page.click( - 'role=button[name="Navigate to the previous view"i]' - ); + await page.click( 'role=button[name="Back"i]' ); await page.click( 'role=button[name="Colors styles"i]' ); await expect( @@ -96,9 +94,7 @@ test.describe( 'Global styles variations', () => { ) ).toHaveCSS( 'background', /rgb\(74, 7, 74\)/ ); - await page.click( - 'role=button[name="Navigate to the previous view"i]' - ); + await page.click( 'role=button[name="Back"i]' ); await page.click( 'role=button[name="Typography styles"i]' ); await page.click( 'role=button[name="Typography Text styles"i]' ); @@ -120,9 +116,7 @@ test.describe( 'Global styles variations', () => { await editor.canvas.locator( 'body' ).click(); await siteEditorStyleVariations.browseStyles(); await page.click( 'role=button[name="yellow"i]' ); - await page.click( - 'role=button[name="Navigate to the previous view"i]' - ); + await page.click( 'role=button[name="Back"i]' ); await page.click( 'role=button[name="Colors styles"i]' ); await expect( @@ -137,9 +131,7 @@ test.describe( 'Global styles variations', () => { ) ).toHaveCSS( 'background', /rgb\(25, 25, 17\)/ ); - await page.click( - 'role=button[name="Navigate to the previous view"i]' - ); + await page.click( 'role=button[name="Back"i]' ); await page.click( 'role=button[name="Typography styles"i]' ); await page.click( 'role=button[name="Typography Text styles"i]' ); @@ -167,9 +159,7 @@ test.describe( 'Global styles variations', () => { await editor.canvas.locator( 'body' ).click(); await siteEditorStyleVariations.browseStyles(); await page.click( 'role=button[name="pink"i]' ); - await page.click( - 'role=button[name="Navigate to the previous view"i]' - ); + await page.click( 'role=button[name="Back"i]' ); await page.click( 'role=button[name="Colors styles"i]' ); await page.click( 'role=button[name="Color palettes"i]' ); diff --git a/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js b/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js index b4848fe9401c4b..666e80eb5eb8b5 100644 --- a/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js +++ b/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js @@ -212,7 +212,7 @@ test.describe( 'Style Revisions', () => { page.getByLabel( 'Global styles revisions list' ) ).toBeVisible(); - await page.click( 'role=button[name="Navigate to the previous view"]' ); + await page.click( 'role=button[name="Back"]' ); await expect( page.getByLabel( 'Global styles revisions list' )