Browse Source

Tests: Added a test checking if the main toolbar has automatic items grouping on.

Aleksander Nowodzinski 6 years ago
parent
commit
629b0e20f0
1 changed files with 33 additions and 27 deletions
  1. 33 27
      packages/ckeditor5-editor-decoupled/tests/decouplededitorui.js

+ 33 - 27
packages/ckeditor5-editor-decoupled/tests/decouplededitorui.js

@@ -136,38 +136,44 @@ describe( 'DecoupledEditorUI', () => {
 			} );
 			} );
 		} );
 		} );
 
 
-		describe( 'view.toolbar#items', () => {
-			it( 'are filled with the config.toolbar (specified as an Array)', () => {
-				return VirtualDecoupledTestEditor
-					.create( '', {
-						toolbar: [ 'foo', 'bar' ]
-					} )
-					.then( editor => {
-						const items = editor.ui.view.toolbar.items;
+		describe( 'view.toolbar', () => {
+			it( 'has automatic items grouping enabled', () => {
+				expect( view.toolbar.shouldGroupWhenFull ).to.be.true;
+			} );
 
 
-						expect( items.get( 0 ).name ).to.equal( 'foo' );
-						expect( items.get( 1 ).name ).to.equal( 'bar' );
+			describe( '#items', () => {
+				it( 'are filled with the config.toolbar (specified as an Array)', () => {
+					return VirtualDecoupledTestEditor
+						.create( '', {
+							toolbar: [ 'foo', 'bar' ]
+						} )
+						.then( editor => {
+							const items = editor.ui.view.toolbar.items;
 
 
-						return editor.destroy();
-					} );
-			} );
+							expect( items.get( 0 ).name ).to.equal( 'foo' );
+							expect( items.get( 1 ).name ).to.equal( 'bar' );
 
 
-			it( 'are filled with the config.toolbar (specified as an Object)', () => {
-				return VirtualDecoupledTestEditor
-					.create( '', {
-						toolbar: {
-							items: [ 'foo', 'bar' ],
-							viewportTopOffset: 100
-						}
-					} )
-					.then( editor => {
-						const items = editor.ui.view.toolbar.items;
+							return editor.destroy();
+						} );
+				} );
 
 
-						expect( items.get( 0 ).name ).to.equal( 'foo' );
-						expect( items.get( 1 ).name ).to.equal( 'bar' );
+				it( 'are filled with the config.toolbar (specified as an Object)', () => {
+					return VirtualDecoupledTestEditor
+						.create( '', {
+							toolbar: {
+								items: [ 'foo', 'bar' ],
+								viewportTopOffset: 100
+							}
+						} )
+						.then( editor => {
+							const items = editor.ui.view.toolbar.items;
 
 
-						return editor.destroy();
-					} );
+							expect( items.get( 0 ).name ).to.equal( 'foo' );
+							expect( items.get( 1 ).name ).to.equal( 'bar' );
+
+							return editor.destroy();
+						} );
+				} );
 			} );
 			} );
 		} );
 		} );