Skip to content
This repository was archived by the owner on Nov 16, 2017. It is now read-only.

t/71 Fixed: Wrong class names and invalid voice label in BoxedEditorUIView. #122

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/editorui/boxed/boxededitoruiview.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ export default class BoxedEditorUIView extends EditorUIView {
role: 'application',
dir: 'ltr',
lang: locale.lang,
'aria-labelledby': `cke-editor__aria-label_${ ariaLabelUid }`
'aria-labelledby': `ck-editor__aria-label_${ ariaLabelUid }`
},

children: [
{
tag: 'span',
attributes: {
id: `cke-editor__aria-label_${ ariaLabelUid }`,
class: 'cke-voice-label',
children: [
// TODO: Editor name?
t( 'Rich Text Editor' )
]
}
id: `ck-editor__aria-label_${ ariaLabelUid }`,
class: 'ck-voice-label',
},
children: [
// TODO: Editor name?
t( 'Rich Text Editor' )
]
},
{
tag: 'div',
Expand Down
16 changes: 12 additions & 4 deletions tests/editorui/boxed/boxededitoruiview.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,26 @@ describe( 'BoxedEditorUIView', () => {
} );

it( 'setups accessibility of the view element', () => {
expect( element.attributes.getNamedItem( 'aria-labelledby' ).value ).to.equal(
view.element.firstChild.id );
expect( element.attributes.getNamedItem( 'aria-labelledby' ).value )
.to.equal( view.element.firstChild.id )
.to.match( /^ck-editor__aria-label_\w+$/ );
expect( element.attributes.getNamedItem( 'role' ).value ).to.equal( 'application' );
expect( element.attributes.getNamedItem( 'lang' ).value ).to.equal( 'en' );
} );

it( 'bootstraps the view region elements from template', () => {
it( 'setups the voice label', () => {
const firstChild = element.firstChild;

expect( firstChild.className ).to.equal( 'ck-voice-label' );
expect( firstChild.textContent ).to.equal( 'Rich Text Editor' );
} );

it( 'bootstraps the view collection elements from template', () => {
expect( element.childNodes[ 1 ].classList.contains( 'ck-editor__top' ) ).to.be.true;
expect( element.childNodes[ 2 ].classList.contains( 'ck-editor__main' ) ).to.be.true;
} );

it( 'setups accessibility of the view region elements', () => {
it( 'setups accessibility of the view collection elements', () => {
expect( element.childNodes[ 1 ].attributes.getNamedItem( 'role' ).value ).to.equal( 'presentation' );
expect( element.childNodes[ 2 ].attributes.getNamedItem( 'role' ).value ).to.equal( 'presentation' );
} );
Expand Down