8
0
Pārlūkot izejas kodu

Code style: Fix code indentation in table commands tests.

Maciej Gołaszewski 7 gadi atpakaļ
vecāks
revīzija
113c300f30

+ 41 - 39
packages/ckeditor5-table/tests/commands/insertcolumncommand.js

@@ -24,55 +24,57 @@ describe( 'InsertColumnCommand', () => {
 	let editor, model, command;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-
-			const conversion = editor.conversion;
-			const schema = model.schema;
-
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows' ],
-				isObject: true
-			} );
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
 
-			schema.register( 'tableRow', { allowIn: 'table' } );
+				const conversion = editor.conversion;
+				const schema = model.schema;
 
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isLimit: true
-			} );
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows' ],
+					isObject: true
+				} );
 
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
+				schema.register( 'tableRow', { allowIn: 'table' } );
 
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isLimit: true
+				} );
 
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
 
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
 
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
 
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
 
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
+			} );
 	} );
 
 	afterEach( () => {

+ 41 - 39
packages/ckeditor5-table/tests/commands/insertrowcommand.js

@@ -24,55 +24,57 @@ describe( 'InsertRowCommand', () => {
 	let editor, model, command;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-
-			const conversion = editor.conversion;
-			const schema = model.schema;
-
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows' ],
-				isObject: true
-			} );
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
 
-			schema.register( 'tableRow', { allowIn: 'table' } );
+				const conversion = editor.conversion;
+				const schema = model.schema;
 
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isLimit: true
-			} );
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows' ],
+					isObject: true
+				} );
 
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
+				schema.register( 'tableRow', { allowIn: 'table' } );
 
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isLimit: true
+				} );
 
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
 
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
 
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
 
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
 
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
+			} );
 	} );
 
 	afterEach( () => {

+ 42 - 40
packages/ckeditor5-table/tests/commands/inserttablecommand.js

@@ -25,56 +25,58 @@ describe( 'InsertTableCommand', () => {
 	let editor, model, command;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-			command = new InsertTableCommand( editor );
-
-			const conversion = editor.conversion;
-			const schema = model.schema;
-
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows' ],
-				isObject: true
-			} );
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
+				command = new InsertTableCommand( editor );
 
-			schema.register( 'tableRow', { allowIn: 'table' } );
+				const conversion = editor.conversion;
+				const schema = model.schema;
 
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isLimit: true
-			} );
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows' ],
+					isObject: true
+				} );
 
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
+				schema.register( 'tableRow', { allowIn: 'table' } );
 
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isLimit: true
+				} );
 
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
 
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
 
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
 
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
 
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
+			} );
 	} );
 
 	afterEach( () => {

+ 40 - 38
packages/ckeditor5-table/tests/commands/mergecellcommand.js

@@ -24,56 +24,58 @@ describe( 'MergeCellCommand', () => {
 	let editor, model, command, root;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-			root = model.document.getRoot( 'main' );
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
+				root = model.document.getRoot( 'main' );
 
-			const conversion = editor.conversion;
-			const schema = model.schema;
+				const conversion = editor.conversion;
+				const schema = model.schema;
 
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows' ],
-				isObject: true
-			} );
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows' ],
+					isObject: true
+				} );
 
-			schema.register( 'tableRow', { allowIn: 'table' } );
+				schema.register( 'tableRow', { allowIn: 'table' } );
 
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isLimit: true
-			} );
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isLimit: true
+				} );
 
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
 
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
 
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
 
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
 
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
 
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
 
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
+			} );
 	} );
 
 	afterEach( () => {

+ 42 - 40
packages/ckeditor5-table/tests/commands/removecolumncommand.js

@@ -24,56 +24,58 @@ describe( 'RemoveColumnCommand', () => {
 	let editor, model, command;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-			command = new RemoveColumnCommand( editor );
-
-			const conversion = editor.conversion;
-			const schema = model.schema;
-
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows', 'headingColumns' ],
-				isObject: true
-			} );
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
+				command = new RemoveColumnCommand( editor );
 
-			schema.register( 'tableRow', { allowIn: 'table' } );
+				const conversion = editor.conversion;
+				const schema = model.schema;
 
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isLimit: true
-			} );
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows', 'headingColumns' ],
+					isObject: true
+				} );
 
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
+				schema.register( 'tableRow', { allowIn: 'table' } );
 
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isLimit: true
+				} );
 
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
 
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
 
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
 
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
 
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
+			} );
 	} );
 
 	afterEach( () => {

+ 58 - 56
packages/ckeditor5-table/tests/commands/setheadercolumncommand.js

@@ -24,63 +24,65 @@ describe( 'HeaderColumnCommand', () => {
 	let editor, model, command;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-			command = new SetHeaderColumnCommand( editor );
-
-			const conversion = editor.conversion;
-			const schema = model.schema;
-
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows' ],
-				isBlock: true,
-				isObject: true
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
+				command = new SetHeaderColumnCommand( editor );
+
+				const conversion = editor.conversion;
+				const schema = model.schema;
+
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows' ],
+					isBlock: true,
+					isObject: true
+				} );
+
+				schema.register( 'tableRow', {
+					allowIn: 'table',
+					allowAttributes: [],
+					isBlock: true,
+					isLimit: true
+				} );
+
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isBlock: true,
+					isLimit: true
+				} );
+
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
+
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
+
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
+
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
+
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
+
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
 			} );
-
-			schema.register( 'tableRow', {
-				allowIn: 'table',
-				allowAttributes: [],
-				isBlock: true,
-				isLimit: true
-			} );
-
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isBlock: true,
-				isLimit: true
-			} );
-
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
-
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
-
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
-
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
-
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
-
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
-
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
-
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
 	} );
 
 	afterEach( () => {

+ 42 - 40
packages/ckeditor5-table/tests/commands/setheaderrowcommand.js

@@ -24,56 +24,58 @@ describe( 'HeaderRowCommand', () => {
 	let editor, model, command;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-			command = new SetHeaderRowCommand( editor );
-
-			const conversion = editor.conversion;
-			const schema = model.schema;
-
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows' ],
-				isObject: true
-			} );
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
+				command = new SetHeaderRowCommand( editor );
 
-			schema.register( 'tableRow', { allowIn: 'table' } );
+				const conversion = editor.conversion;
+				const schema = model.schema;
 
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isLimit: true
-			} );
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows' ],
+					isObject: true
+				} );
 
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
+				schema.register( 'tableRow', { allowIn: 'table' } );
 
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isLimit: true
+				} );
 
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
 
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
 
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
 
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
 
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
+			} );
 	} );
 
 	afterEach( () => {

+ 42 - 40
packages/ckeditor5-table/tests/commands/splitcellcommand.js

@@ -24,56 +24,58 @@ describe( 'SplitCellCommand', () => {
 	let editor, model, command;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( {
-			plugins: [ TableUtils ]
-		} ).then( newEditor => {
-			editor = newEditor;
-			model = editor.model;
-			command = new SplitCellCommand( editor );
-
-			const conversion = editor.conversion;
-			const schema = model.schema;
-
-			schema.register( 'table', {
-				allowWhere: '$block',
-				allowAttributes: [ 'headingRows' ],
-				isObject: true
-			} );
+		return ModelTestEditor
+			.create( {
+				plugins: [ TableUtils ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				model = editor.model;
+				command = new SplitCellCommand( editor );
 
-			schema.register( 'tableRow', { allowIn: 'table' } );
+				const conversion = editor.conversion;
+				const schema = model.schema;
 
-			schema.register( 'tableCell', {
-				allowIn: 'tableRow',
-				allowContentOf: '$block',
-				allowAttributes: [ 'colspan', 'rowspan' ],
-				isLimit: true
-			} );
+				schema.register( 'table', {
+					allowWhere: '$block',
+					allowAttributes: [ 'headingRows' ],
+					isObject: true
+				} );
 
-			model.schema.register( 'p', { inheritAllFrom: '$block' } );
+				schema.register( 'tableRow', { allowIn: 'table' } );
 
-			// Table conversion.
-			conversion.for( 'upcast' ).add( upcastTable() );
-			conversion.for( 'downcast' ).add( downcastInsertTable() );
+				schema.register( 'tableCell', {
+					allowIn: 'tableRow',
+					allowContentOf: '$block',
+					allowAttributes: [ 'colspan', 'rowspan' ],
+					isLimit: true
+				} );
 
-			// Insert row conversion.
-			conversion.for( 'downcast' ).add( downcastInsertRow() );
+				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
-			// Remove row conversion.
-			conversion.for( 'downcast' ).add( downcastRemoveRow() );
+				// Table conversion.
+				conversion.for( 'upcast' ).add( upcastTable() );
+				conversion.for( 'downcast' ).add( downcastInsertTable() );
 
-			// Table cell conversion.
-			conversion.for( 'downcast' ).add( downcastInsertCell() );
+				// Insert row conversion.
+				conversion.for( 'downcast' ).add( downcastInsertRow() );
 
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
-			conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+				// Remove row conversion.
+				conversion.for( 'downcast' ).add( downcastRemoveRow() );
 
-			// Table attributes conversion.
-			conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
-			conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+				// Table cell conversion.
+				conversion.for( 'downcast' ).add( downcastInsertCell() );
 
-			conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
-			conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
-		} );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'td' } ) );
+				conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'tableCell', view: 'th' } ) );
+
+				// Table attributes conversion.
+				conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
+				conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
+
+				conversion.for( 'downcast' ).add( downcastTableHeadingColumnsChange() );
+				conversion.for( 'downcast' ).add( downcastTableHeadingRowsChange() );
+			} );
 	} );
 
 	afterEach( () => {