Skip to content

Commit

Permalink
Added test case
Browse files Browse the repository at this point in the history
  • Loading branch information
engineering-this committed Nov 20, 2018
1 parent dee0c63 commit 507a5ec
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/plugins/splitbutton/splitbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
'default': 'bold'
} );

editor.ui.add( 'wrongdefault', CKEDITOR.UI_SPLITBUTTON, {
items: items,
'default': 'foo'
} );

editor.ui.add( 'staticface', CKEDITOR.UI_SPLITBUTTON, {
face: {
command: 'bold',
Expand Down Expand Up @@ -67,6 +72,12 @@
toolbar: [ [ {
type: 'splitbutton',
name: 'teststylesplit',
'default': 'bold',
items: items
}, {
type: 'splitbutton',
name: 'wrongdefault',
'default': 'foo',
items: items
}, {
type: 'splitbutton',
Expand Down Expand Up @@ -120,6 +131,14 @@
assert.isTrue( key in items );
}
},
'test split button with wrong default item value': function( editor ) {
var splitButton = editor.ui.get( 'wrongdefault' ),
button = splitButton.buttons.bold0,
element = CKEDITOR.document.findOne( '#' + button._.id );

// Bold as first item should become default item and be visible.
assert.isFalse( element.getStyle( 'display' ) === 'none' );
},
'test state of split button buttons': function( editor ) {
var splitButton = editor.ui.get( 'teststylesplit' ),
arrow = CKEDITOR.document.getById( splitButton._.id ),
Expand Down

0 comments on commit 507a5ec

Please sign in to comment.