Skip to content

Commit

Permalink
Simplify sidebar tabs aria-labels. (#11618)
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia authored and gziolo committed Nov 22, 2018
1 parent 9cc03c0 commit 6e8e1bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import SidebarHeader from '../sidebar-header';
const SettingsHeader = ( { openDocumentSettings, openBlockSettings, sidebarName } ) => {
const blockLabel = __( 'Block' );
const [ documentAriaLabel, documentActiveClass ] = sidebarName === 'edit-post/document' ?
// translators: ARIA label for the Document Settings sidebar tab, selected.
[ __( 'Document settings (selected)' ), 'is-active' ] :
// translators: ARIA label for the Document Settings sidebar tab, not selected.
[ __( 'Document settings' ), '' ];
// translators: ARIA label for the Document sidebar tab, selected.
[ __( 'Document (selected)' ), 'is-active' ] :
// translators: ARIA label for the Document sidebar tab, not selected.
[ __( 'Document' ), '' ];

const [ blockAriaLabel, blockActiveClass ] = sidebarName === 'edit-post/block' ?
// translators: ARIA label for the Block Settings sidebar tab, selected.
[ __( 'Block settings (selected)' ), 'is-active' ] :
// translators: ARIA label for the Block Settings sidebar tab, not selected.
[ __( 'Block settings' ), '' ];
// translators: ARIA label for the Block sidebar tab, selected.
[ __( 'Block (selected)' ), 'is-active' ] :
// translators: ARIA label for the Block sidebar tab, not selected.
[ __( 'Block' ), '' ];

return (
<SidebarHeader
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/preferences.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe( 'preferences', () => {
expect( await getActiveSidebarTabText() ).toBe( 'Document' );

// Change to "Block" tab.
await page.click( '.edit-post-sidebar__panel-tab[aria-label="Block settings"]' );
await page.click( '.edit-post-sidebar__panel-tab[aria-label="Block"]' );
expect( await getActiveSidebarTabText() ).toBe( 'Block' );

// Regression test: Reload resets to document tab.
Expand Down

0 comments on commit 6e8e1bc

Please sign in to comment.