diff --git a/tests/plugins/splitbutton/splitbutton.js b/tests/plugins/splitbutton/splitbutton.js index 9a1fe9202b5..313c753f3a7 100644 --- a/tests/plugins/splitbutton/splitbutton.js +++ b/tests/plugins/splitbutton/splitbutton.js @@ -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', @@ -67,6 +72,12 @@ toolbar: [ [ { type: 'splitbutton', name: 'teststylesplit', + 'default': 'bold', + items: items + }, { + type: 'splitbutton', + name: 'wrongdefault', + 'default': 'foo', items: items }, { type: 'splitbutton', @@ -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 ),