Skip to content

Commit

Permalink
Add tooltip to several Back buttons. (WordPress#59760)
Browse files Browse the repository at this point in the history
Co-authored-by: afercia <[email protected]>
Co-authored-by: alexstine <[email protected]>
  • Loading branch information
3 people authored Mar 13, 2024
1 parent 95cc88f commit 8f2fad4
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function ScreenHeader( { title } ) {
}
icon={ isRTL() ? chevronRight : chevronLeft }
size="small"
aria-label={ __( 'Navigate to the previous view' ) }
label={ __( 'Back' ) }
/>
<Spacer>
<Heading level={ 5 }>{ title }</Heading>
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-test-utils/src/site-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ function FontCollection( { slug } ) {
onClick={ () => {
setSelectedFont( null );
} }
aria-label={ __( 'Navigate to the previous view' ) }
label={ __( 'Back' ) }
/>
<Heading
level={ 2 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function InstalledFonts() {
onClick={ () => {
handleSetLibraryFontSelected( null );
} }
aria-label={ __( 'Navigate to the previous view' ) }
label={ __( 'Back' ) }
/>
<Heading
level={ 2 }
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/global-styles/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function ScreenHeader( { title, description, onBack } ) {
}
icon={ isRTL() ? chevronRight : chevronLeft }
size="small"
aria-label={ __( 'Navigate to the previous view' ) }
label={ __( 'Back' ) }
onClick={ onBack }
/>
<Spacer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ export default function PreferencesModalTabs( { sections } ) {
? chevronRight
: chevronLeft
}
aria-label={ __(
'Navigate to the previous view'
) }
label={ __( 'Back' ) }
/>
<Text size="16">
{ section.tabLabel }
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/specs/site-editor/style-book.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]' )
Expand Down Expand Up @@ -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' } )
Expand Down
20 changes: 5 additions & 15 deletions test/e2e/specs/site-editor/style-variations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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]' );

Expand All @@ -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(
Expand All @@ -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]' );

Expand Down Expand Up @@ -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]' );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' )
Expand Down

0 comments on commit 8f2fad4

Please sign in to comment.