瀏覽代碼

Use table editing for merge cells command tests.

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

+ 11 - 16
packages/ckeditor5-table/tests/commands/mergecellscommand.js

@@ -7,29 +7,24 @@ import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltestedit
 import { getData, setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 
 import MergeCellsCommand from '../../src/commands/mergecellscommand';
-import { defaultConversion, defaultSchema, modelTable } from '../_utils/utils';
-import TableUtils from '../../src/tableutils';
+import { modelTable } from '../_utils/utils';
 import { assertEqualMarkup } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 import TableSelection from '../../src/tableselection';
+import TableEditing from '../../src/tableediting';
+import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 
 describe( 'MergeCellsCommand', () => {
 	let editor, model, command, root;
 
-	beforeEach( () => {
-		return ModelTestEditor
-			.create( {
-				plugins: [ TableUtils, TableSelection ]
-			} )
-			.then( newEditor => {
-				editor = newEditor;
-				model = editor.model;
-				root = model.document.getRoot( 'main' );
+	beforeEach( async () => {
+		editor = await ModelTestEditor.create( {
+			plugins: [ Paragraph, TableEditing, TableSelection ]
+		} );
 
-				command = new MergeCellsCommand( editor );
+		model = editor.model;
+		root = model.document.getRoot( 'main' );
 
-				defaultSchema( model.schema );
-				defaultConversion( editor.conversion );
-			} );
+		command = new MergeCellsCommand( editor );
 	} );
 
 	afterEach( () => {
@@ -245,7 +240,7 @@ describe( 'MergeCellsCommand', () => {
 	} );
 
 	describe( 'execute()', () => {
-		it( 'should merge table cells', () => {
+		it( 'should merge simple table cell selection', () => {
 			setData( model, modelTable( [
 				[ '[]00', '01' ]
 			] ) );