瀏覽代碼

Fix render() tests

panr 5 年之前
父節點
當前提交
c51415d4e2
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      packages/ckeditor5-editor-inline/tests/inlineeditoruiview.js

+ 4 - 2
packages/ckeditor5-editor-inline/tests/inlineeditoruiview.js

@@ -83,6 +83,9 @@ describe( 'InlineEditorUIView', () => {
 
 	describe( 'render()', () => {
 		beforeEach( () => {
+			// We need to set this option explicitly before render phase,
+			// otherwise it is `undefined` and toolbar items grouping will be skipped in tests.
+			view.toolbar.options.shouldGroupWhenFull = true;
 			view.render();
 		} );
 
@@ -102,8 +105,8 @@ describe( 'InlineEditorUIView', () => {
 			// Sometimes this test can fail, due to the fact that it have to wait for async ResizeObserver execution.
 			it( 'max-width should be set to the width of the editable element', done => {
 				const viewElement = view.editable.element;
-				global.document.body.appendChild( viewElement );
 
+				global.document.body.appendChild( viewElement );
 				expect( global.document.body.contains( viewElement ) ).to.be.true;
 
 				viewElement.style.width = '400px';
@@ -114,7 +117,6 @@ describe( 'InlineEditorUIView', () => {
 				// See more: https://twitter.com/paul_irish/status/912693347315150849/photo/1
 				setTimeout( () => {
 					const editableWidthWithPadding = toPx( new Rect( viewElement ).width );
-
 					expect( view.toolbar.maxWidth ).to.be.equal( editableWidthWithPadding );
 
 					global.document.body.removeChild( viewElement );