Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify sidebar tabs aria-labels. #11618

Merged
merged 1 commit into from Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,16 +18,16 @@ const SettingsHeader = ( { count, openDocumentSettings, openBlockSettings, sideb
sprintf( _n( '%d Block', '%d Blocks', blockCount ), blockCount );

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
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