Browse Source

Add test for checking if grouping items can be disabled from balloon toolbar config

panr 6 years ago
parent
commit
fb61f6f0d2
1 changed files with 21 additions and 0 deletions
  1. 21 0
      packages/ckeditor5-ui/tests/toolbar/balloon/balloontoolbar.js

+ 21 - 0
packages/ckeditor5-ui/tests/toolbar/balloon/balloontoolbar.js

@@ -102,6 +102,27 @@ describe( 'BalloonToolbar', () => {
 			} );
 	} );
 
+	it( 'balloon toolbar should not group items when shouldNotGroupWhenFull option is enabled', () => {
+		const editorElement = document.createElement( 'div' );
+		document.body.appendChild( editorElement );
+
+		return ClassicTestEditor.create( editorElement, {
+			plugins: [ Paragraph, Bold, Italic, Underline, BalloonToolbar ],
+			balloonToolbar: {
+				items: [ 'bold', 'italic', 'underline' ],
+				shouldNotGroupWhenFull: true
+			}
+		} ).then( editor => {
+			const balloonToolbar = editor.plugins.get( BalloonToolbar );
+
+			expect( balloonToolbar.toolbarView.options.shouldGroupWhenFull ).to.be.false;
+
+			return editor.destroy();
+		} ).then( () => {
+			editorElement.remove();
+		} );
+	} );
+
 	it( 'should fire internal `_selectionChangeDebounced` event 200 ms after last selection change', () => {
 		const clock = testUtils.sinon.useFakeTimers();
 		const spy = testUtils.sinon.spy();