瀏覽代碼

Merge branch t/ckeditor5-table

Tests: Updated tests after introducing selection post-fixer.
Piotrek Koszuliński 7 年之前
父節點
當前提交
6e02b8c6e1
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      packages/ckeditor5-ui/tests/toolbar/block/blocktoolbar.js

+ 5 - 0
packages/ckeditor5-ui/tests/toolbar/block/blocktoolbar.js

@@ -227,6 +227,8 @@ describe( 'BlockToolbar', () => {
 		} );
 
 		it( 'should not display the button when the selection is placed in a root element', () => {
+			editor.model.schema.extend( '$text', { allowIn: '$root' } );
+
 			setData( editor.model, '<paragraph>foo</paragraph>[]<paragraph>bar</paragraph>' );
 
 			expect( blockToolbar.buttonView.isVisible ).to.be.false;
@@ -400,8 +402,11 @@ describe( 'BlockToolbar', () => {
 		} );
 
 		it( 'should update the button position on browser resize only when the button is visible', () => {
+			editor.model.schema.extend( '$text', { allowIn: '$root' } );
+
 			const spy = testUtils.sinon.spy( blockToolbar, '_attachButtonToElement' );
 
+			// Place the selection outside of any block because the toolbar will not be shown in this case.
 			setData( editor.model, '[]<paragraph>bar</paragraph>' );
 
 			window.dispatchEvent( new Event( 'resize' ) );