Explorar el Código

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

Aleksander Nowodzinski hace 6 años
padre
commit
4b6432206e
Se han modificado 1 ficheros con 33 adiciones y 27 borrados
  1. 33 27
      packages/ckeditor5-editor-classic/tests/classiceditorui.js

+ 33 - 27
packages/ckeditor5-editor-classic/tests/classiceditorui.js

@@ -164,38 +164,44 @@ describe( 'ClassicEditorUI', () => {
 			} );
 		} );
 
-		describe( 'view.toolbar#items', () => {
-			it( 'are filled with the config.toolbar (specified as an Array)', () => {
-				return VirtualClassicTestEditor
-					.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 VirtualClassicTestEditor
+						.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 VirtualClassicTestEditor
-					.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 VirtualClassicTestEditor
+						.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();
+						} );
+				} );
 			} );
 		} );