瀏覽代碼

Use TableEditing in MergeCellCommand tests.

Maciej Gołaszewski 5 年之前
父節點
當前提交
2c5a831228
共有 1 個文件被更改,包括 16 次插入9 次删除
  1. 16 9
      packages/ckeditor5-table/tests/commands/mergecellcommand.js

+ 16 - 9
packages/ckeditor5-table/tests/commands/mergecellcommand.js

@@ -7,9 +7,11 @@ import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltestedit
 import { getData, setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 
 import MergeCellCommand from '../../src/commands/mergecellcommand';
-import { defaultConversion, defaultSchema, modelTable } from '../_utils/utils';
+import { modelTable } from '../_utils/utils';
 import TableUtils from '../../src/tableutils';
 import { assertEqualMarkup } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
+import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
+import TableEditing from '../../src/tableediting';
 
 describe( 'MergeCellCommand', () => {
 	let editor, model, command, root;
@@ -17,15 +19,12 @@ describe( 'MergeCellCommand', () => {
 	beforeEach( () => {
 		return ModelTestEditor
 			.create( {
-				plugins: [ TableUtils ]
+				plugins: [ Paragraph, TableEditing, TableUtils ]
 			} )
 			.then( newEditor => {
 				editor = newEditor;
 				model = editor.model;
 				root = model.document.getRoot( 'main' );
-
-				defaultSchema( model.schema );
-				defaultConversion( editor.conversion );
 			} );
 	} );
 
@@ -65,7 +64,9 @@ describe( 'MergeCellCommand', () => {
 
 			it( 'should be false if in a cell that has sibling but with different rowspan', () => {
 				setData( model, modelTable( [
-					[ { rowspan: 2, contents: '00[]' }, { rowspan: 3, contents: '01' } ]
+					[ { rowspan: 2, contents: '00[]' }, { rowspan: 3, contents: '01' }, '02' ],
+					[ '12' ],
+					[ '20', '22' ]
 				] ) );
 
 				expect( command.isEnabled ).to.be.false;
@@ -173,7 +174,9 @@ describe( 'MergeCellCommand', () => {
 
 			it( 'should be undefined if in a cell that has sibling but with different rowspan', () => {
 				setData( model, modelTable( [
-					[ { rowspan: 2, contents: '00[]' }, { rowspan: 3, contents: '01' } ]
+					[ { rowspan: 2, contents: '00[]' }, { rowspan: 3, contents: '01' }, '02' ],
+					[ '12' ],
+					[ '20', '22' ]
 				] ) );
 
 				expect( command.value ).to.be.undefined;
@@ -309,7 +312,9 @@ describe( 'MergeCellCommand', () => {
 
 			it( 'should be false if in a cell that has sibling but with different rowspan', () => {
 				setData( model, modelTable( [
-					[ { rowspan: 2, contents: '00' }, { rowspan: 3, contents: '01[]' } ]
+					[ { rowspan: 2, contents: '00' }, { rowspan: 3, contents: '01[]' } ],
+					[ '12' ],
+					[ '20', '22' ]
 				] ) );
 
 				expect( command.isEnabled ).to.be.false;
@@ -409,7 +414,9 @@ describe( 'MergeCellCommand', () => {
 
 			it( 'should be undefined if in a cell that has sibling but with different rowspan', () => {
 				setData( model, modelTable( [
-					[ { rowspan: 2, contents: '00' }, { rowspan: 3, contents: '01[]' } ]
+					[ { rowspan: 2, contents: '00' }, { rowspan: 3, contents: '01[]' } ],
+					[ '12' ],
+					[ '20', '22' ]
 				] ) );
 
 				expect( command.value ).to.be.undefined;