Kaynağa Gözat

Add tests for commands in table cell properties editing.

Maciej Gołaszewski 6 yıl önce
ebeveyn
işleme
aa496b1019

+ 612 - 557
packages/ckeditor5-table/tests/tablecellproperties/tablecellpropertiesediting.js

@@ -9,350 +9,336 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import TableEditing from '../../src/tableediting';
 import TableCellPropertiesEditing from '../../src/tablecellproperties/tablecellpropertiesediting';
 
+import TableCellBorderColorCommand from '../../src/tablecellproperties/commands/tablecellbordercolorcommand';
+import TableCellBorderStyleCommand from '../../src/tablecellproperties/commands/tablecellborderstylecommand';
+import TableCellBorderWidthCommand from '../../src/tablecellproperties/commands/tablecellborderwidthcommand';
+import TableCellHorizontalAlignmentCommand from '../../src/tablecellproperties/commands/tablecellhorizontalalignmentcommand';
+import TableCellWidthCommand from '../../src/tablecellproperties/commands/tablecellwidthcommand';
+import TableCellHeightCommand from '../../src/tablecellproperties/commands/tablecellheightcommand';
+import TableCellVerticalAlignmentCommand from '../../src/tablecellproperties/commands/tablecellverticalalignmentcommand';
+import TableCellPaddingCommand from '../../src/tablecellproperties/commands/tablecellpaddingcommand';
+import TableCellBackgroundColorCommand from '../../src/tablecellproperties/commands/tablecellbackgroundcolorcommand';
+
 import { setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import { assertEqualMarkup } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 import { assertTableCellStyle, assertTRBLAttribute } from '../_utils/utils';
 
-describe( 'TableCellPropertiesEditing', () => {
-	let editor, model;
+describe( 'TableCellProperties', () => {
+	describe( 'TableCellPropertiesEditing', () => {
+		let editor, model;
 
-	beforeEach( async () => {
-		editor = await VirtualTestEditor.create( {
-			plugins: [ TableCellPropertiesEditing, Paragraph, TableEditing ]
-		} );
+		beforeEach( async () => {
+			editor = await VirtualTestEditor.create( {
+				plugins: [ TableCellPropertiesEditing, Paragraph, TableEditing ]
+			} );
 
-		model = editor.model;
-	} );
+			model = editor.model;
+		} );
 
-	afterEach( async () => {
-		await editor.destroy();
-	} );
+		afterEach( async () => {
+			await editor.destroy();
+		} );
 
-	it( 'should have pluginName', () => {
-		expect( TableCellPropertiesEditing.pluginName ).to.equal( 'TableCellPropertiesEditing' );
-	} );
+		it( 'should have pluginName', () => {
+			expect( TableCellPropertiesEditing.pluginName ).to.equal( 'TableCellPropertiesEditing' );
+		} );
 
-	describe( 'border', () => {
-		it( 'should set proper schema rules', () => {
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'borderColor' ) ).to.be.true;
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'borderStyle' ) ).to.be.true;
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'borderWidth' ) ).to.be.true;
+		it( 'adds tableCellBorderColor command', () => {
+			expect( editor.commands.get( 'tableCellBorderColor' ) ).to.be.instanceOf( TableCellBorderColorCommand );
 		} );
 
-		describe( 'upcast conversion', () => {
-			it( 'should upcast border shorthand', () => {
-				editor.setData( '<table><tr><td style="border:1px solid #f00">foo</td></tr></table>' );
+		it( 'adds tableCellBorderStyle command', () => {
+			expect( editor.commands.get( 'tableCellBorderStyle' ) ).to.be.instanceOf( TableCellBorderStyleCommand );
+		} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+		it( 'adds tableCellBorderWidth command', () => {
+			expect( editor.commands.get( 'tableCellBorderWidth' ) ).to.be.instanceOf( TableCellBorderWidthCommand );
+		} );
 
-				assertTRBLAttribute( tableCell, 'borderColor', '#f00' );
-				assertTRBLAttribute( tableCell, 'borderStyle', 'solid' );
-				assertTRBLAttribute( tableCell, 'borderWidth', '1px' );
-			} );
+		it( 'adds tableCellAlignment command', () => {
+			expect( editor.commands.get( 'tableCellHorizontalAlignment' ) ).to.be.instanceOf( TableCellHorizontalAlignmentCommand );
+		} );
 
-			it( 'should upcast border-color shorthand', () => {
-				editor.setData( '<table><tr><td style="border-color:#f00">foo</td></tr></table>' );
+		it( 'adds tableCellAlignment command', () => {
+			expect( editor.commands.get( 'tableCellVerticalAlignment' ) ).to.be.instanceOf( TableCellVerticalAlignmentCommand );
+		} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+		it( 'adds tableCellPadding command', () => {
+			expect( editor.commands.get( 'tableCellPadding' ) ).to.be.instanceOf( TableCellPaddingCommand );
+		} );
 
-				assertTRBLAttribute( tableCell, 'borderColor', '#f00' );
-			} );
+		it( 'adds tableCellBackgroundColor command', () => {
+			expect( editor.commands.get( 'tableCellBackgroundColor' ) ).to.be.instanceOf( TableCellBackgroundColorCommand );
+		} );
 
-			it( 'should upcast border-style shorthand', () => {
-				editor.setData( '<table><tr><td style="border-style:ridge">foo</td></tr></table>' );
+		it( 'adds tableCellWidth command', () => {
+			expect( editor.commands.get( 'tableCellWidth' ) ).to.be.instanceOf( TableCellWidthCommand );
+		} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+		it( 'adds tableCellHeight command', () => {
+			expect( editor.commands.get( 'tableCellHeight' ) ).to.be.instanceOf( TableCellHeightCommand );
+		} );
 
-				assertTRBLAttribute( tableCell, 'borderStyle', 'ridge' );
+		describe( 'border', () => {
+			it( 'should set proper schema rules', () => {
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'borderColor' ) ).to.be.true;
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'borderStyle' ) ).to.be.true;
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'borderWidth' ) ).to.be.true;
 			} );
 
-			it( 'should upcast border-width shorthand', () => {
-				editor.setData( '<table><tr><td style="border-width:1px">foo</td></tr></table>' );
-
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+			describe( 'upcast conversion', () => {
+				it( 'should upcast border shorthand', () => {
+					editor.setData( '<table><tr><td style="border:1px solid #f00">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderWidth', '1px' );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-top shorthand', () => {
-				editor.setData( '<table><tr><td style="border-top:1px solid #f00">foo</td></tr></table>' );
+					assertTRBLAttribute( tableCell, 'borderColor', '#f00' );
+					assertTRBLAttribute( tableCell, 'borderStyle', 'solid' );
+					assertTRBLAttribute( tableCell, 'borderWidth', '1px' );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-color shorthand', () => {
+					editor.setData( '<table><tr><td style="border-color:#f00">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderColor', '#f00', null, null, null );
-				assertTRBLAttribute( tableCell, 'borderStyle', 'solid', null, null, null );
-				assertTRBLAttribute( tableCell, 'borderWidth', '1px', null, null, null );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-right shorthand', () => {
-				editor.setData( '<table><tr><td style="border-right:1px solid #f00">foo</td></tr></table>' );
+					assertTRBLAttribute( tableCell, 'borderColor', '#f00' );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-style shorthand', () => {
+					editor.setData( '<table><tr><td style="border-style:ridge">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderColor', null, '#f00', null, null );
-				assertTRBLAttribute( tableCell, 'borderStyle', null, 'solid', null, null );
-				assertTRBLAttribute( tableCell, 'borderWidth', null, '1px', null, null );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-bottom shorthand', () => {
-				editor.setData( '<table><tr><td style="border-bottom:1px solid #f00">foo</td></tr></table>' );
+					assertTRBLAttribute( tableCell, 'borderStyle', 'ridge' );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-width shorthand', () => {
+					editor.setData( '<table><tr><td style="border-width:1px">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderColor', null, null, '#f00', null );
-				assertTRBLAttribute( tableCell, 'borderStyle', null, null, 'solid', null );
-				assertTRBLAttribute( tableCell, 'borderWidth', null, null, '1px', null );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-left shorthand', () => {
-				editor.setData( '<table><tr><td style="border-left:1px solid #f00">foo</td></tr></table>' );
+					assertTRBLAttribute( tableCell, 'borderWidth', '1px' );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-top shorthand', () => {
+					editor.setData( '<table><tr><td style="border-top:1px solid #f00">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderColor', null, null, null, '#f00' );
-				assertTRBLAttribute( tableCell, 'borderStyle', null, null, null, 'solid' );
-				assertTRBLAttribute( tableCell, 'borderWidth', null, null, null, '1px' );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast mixed shorthands', () => {
-				editor.setData(
-					'<table><tr><td style="border-top:1px solid #f00;border-bottom:2em ridge rgba(255,0,0,1)">foo</td></tr></table>'
-				);
+					assertTRBLAttribute( tableCell, 'borderColor', '#f00', null, null, null );
+					assertTRBLAttribute( tableCell, 'borderStyle', 'solid', null, null, null );
+					assertTRBLAttribute( tableCell, 'borderWidth', '1px', null, null, null );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-right shorthand', () => {
+					editor.setData( '<table><tr><td style="border-right:1px solid #f00">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderColor', '#f00', null, 'rgba(255, 0, 0, 1)', null );
-				assertTRBLAttribute( tableCell, 'borderStyle', 'solid', null, 'ridge', null );
-				assertTRBLAttribute( tableCell, 'borderWidth', '1px', null, '2em', null );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-top-* styles', () => {
-				editor.setData(
-					'<table><tr><td style="border-top-width:1px;border-top-style:solid;border-top-color:#f00">foo</td></tr></table>'
-				);
+					assertTRBLAttribute( tableCell, 'borderColor', null, '#f00', null, null );
+					assertTRBLAttribute( tableCell, 'borderStyle', null, 'solid', null, null );
+					assertTRBLAttribute( tableCell, 'borderWidth', null, '1px', null, null );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-bottom shorthand', () => {
+					editor.setData( '<table><tr><td style="border-bottom:1px solid #f00">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderColor', '#f00', null, null, null );
-				assertTRBLAttribute( tableCell, 'borderStyle', 'solid', null, null, null );
-				assertTRBLAttribute( tableCell, 'borderWidth', '1px', null, null, null );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-right-* styles', () => {
-				editor.setData(
-					'<table><tr><td style="border-right-width:1px;border-right-style:solid;border-right-color:#f00">foo</td></tr></table>'
-				);
+					assertTRBLAttribute( tableCell, 'borderColor', null, null, '#f00', null );
+					assertTRBLAttribute( tableCell, 'borderStyle', null, null, 'solid', null );
+					assertTRBLAttribute( tableCell, 'borderWidth', null, null, '1px', null );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-left shorthand', () => {
+					editor.setData( '<table><tr><td style="border-left:1px solid #f00">foo</td></tr></table>' );
 
-				assertTRBLAttribute( tableCell, 'borderColor', null, '#f00', null, null );
-				assertTRBLAttribute( tableCell, 'borderStyle', null, 'solid', null, null );
-				assertTRBLAttribute( tableCell, 'borderWidth', null, '1px', null, null );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-bottom-* styles', () => {
-				editor.setData(
-					'<table>' +
-						'<tr>' +
-							'<td style="border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#f00">foo</td>' +
-						'</tr>' +
-					'</table>'
-				);
+					assertTRBLAttribute( tableCell, 'borderColor', null, null, null, '#f00' );
+					assertTRBLAttribute( tableCell, 'borderStyle', null, null, null, 'solid' );
+					assertTRBLAttribute( tableCell, 'borderWidth', null, null, null, '1px' );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast mixed shorthands', () => {
+					editor.setData(
+						'<table><tr><td style="border-top:1px solid #f00;border-bottom:2em ridge rgba(255,0,0,1)">foo</td></tr></table>'
+					);
 
-				assertTRBLAttribute( tableCell, 'borderColor', null, null, '#f00', null );
-				assertTRBLAttribute( tableCell, 'borderStyle', null, null, 'solid', null );
-				assertTRBLAttribute( tableCell, 'borderWidth', null, null, '1px', null );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should upcast border-left-* styles', () => {
-				editor.setData(
-					'<table>' +
-						'<tr>' +
-							'<td style="border-left-width:1px;border-left-style:solid;border-left-color:#f00">foo</td>' +
-						'</tr>' +
-					'</table>'
-				);
+					assertTRBLAttribute( tableCell, 'borderColor', '#f00', null, 'rgba(255, 0, 0, 1)', null );
+					assertTRBLAttribute( tableCell, 'borderStyle', 'solid', null, 'ridge', null );
+					assertTRBLAttribute( tableCell, 'borderWidth', '1px', null, '2em', null );
+				} );
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast border-top-* styles', () => {
+					editor.setData(
+						'<table><tr><td style="border-top-width:1px;border-top-style:solid;border-top-color:#f00">foo</td></tr></table>'
+					);
 
-				assertTRBLAttribute( tableCell, 'borderColor', null, null, null, '#f00' );
-				assertTRBLAttribute( tableCell, 'borderStyle', null, null, null, 'solid' );
-				assertTRBLAttribute( tableCell, 'borderWidth', null, null, null, '1px' );
-			} );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-			it( 'should allow to be overriden (only border-top consumed)', () => {
-				editor.conversion.for( 'upcast' ).add( dispatcher => dispatcher.on( 'element:td', ( evt, data, conversionApi ) => {
-					conversionApi.consumable.consume( data.viewItem, {
-						styles: [ 'border-top' ]
-					} );
-				}, { priority: 'high' } ) );
+					assertTRBLAttribute( tableCell, 'borderColor', '#f00', null, null, null );
+					assertTRBLAttribute( tableCell, 'borderStyle', 'solid', null, null, null );
+					assertTRBLAttribute( tableCell, 'borderWidth', '1px', null, null, null );
+				} );
 
-				editor.setData( '<table><tr><td style="border:1px solid blue;">foo</td></tr></table>' );
+				it( 'should upcast border-right-* styles', () => {
+					editor.setData(
+						'<table>' +
+							'<tr>' +
+								'<td style="border-right-width:1px;border-right-style:solid;border-right-color:#f00">foo</td>' +
+							'</tr>' +
+						'</table>'
+					);
 
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				expect( tableCell.getAttribute( 'borderColor' ) ).to.be.undefined;
-				expect( tableCell.getAttribute( 'borderStyle' ) ).to.be.undefined;
-				expect( tableCell.getAttribute( 'borderWidth' ) ).to.be.undefined;
-			} );
-		} );
+					assertTRBLAttribute( tableCell, 'borderColor', null, '#f00', null, null );
+					assertTRBLAttribute( tableCell, 'borderStyle', null, 'solid', null, null );
+					assertTRBLAttribute( tableCell, 'borderWidth', null, '1px', null, null );
+				} );
 
-		describe( 'downcast conversion', () => {
-			let tableCell;
-
-			beforeEach( () => {
-				setModelData(
-					model,
-					'<table headingRows="0" headingColumns="0">' +
-						'<tableRow>' +
-							'<tableCell>' +
-								'<paragraph>foo</paragraph>' +
-							'</tableCell>' +
-						'</tableRow>' +
-					'</table>'
-				);
-				tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
-			} );
+				it( 'should upcast border-bottom-* styles', () => {
+					editor.setData(
+						'<table>' +
+							'<tr>' +
+								'<td style="border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#f00">foo</td>' +
+							'</tr>' +
+						'</table>'
+					);
 
-			it( 'should downcast borderColor attribute (same top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'borderColor', {
-					top: '#f00',
-					right: '#f00',
-					bottom: '#f00',
-					left: '#f00'
-				}, tableCell ) );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				assertTableCellStyle( editor, 'border-bottom:#f00;border-left:#f00;border-right:#f00;border-top:#f00;' );
-			} );
+					assertTRBLAttribute( tableCell, 'borderColor', null, null, '#f00', null );
+					assertTRBLAttribute( tableCell, 'borderStyle', null, null, 'solid', null );
+					assertTRBLAttribute( tableCell, 'borderWidth', null, null, '1px', null );
+				} );
 
-			it( 'should downcast borderColor attribute (different top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'borderColor', {
-					top: '#f00',
-					right: 'hsla(0, 100%, 50%, 0.5)',
-					bottom: 'deeppink',
-					left: 'rgb(255, 0, 0)'
-				}, tableCell ) );
-
-				assertTableCellStyle( editor,
-					'border-bottom:deeppink;' +
-					'border-left:rgb(255, 0, 0);' +
-					'border-right:hsla(0, 100%, 50%, 0.5);' +
-					'border-top:#f00;'
-				);
-			} );
+				it( 'should upcast border-left-* styles', () => {
+					editor.setData(
+						'<table>' +
+							'<tr>' +
+								'<td style="border-left-width:1px;border-left-style:solid;border-left-color:#f00">foo</td>' +
+							'</tr>' +
+						'</table>'
+					);
 
-			it( 'should downcast borderStyle attribute (same top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'borderStyle', {
-					top: 'solid',
-					right: 'solid',
-					bottom: 'solid',
-					left: 'solid'
-				}, tableCell ) );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				assertTableCellStyle( editor, 'border-bottom:solid;border-left:solid;border-right:solid;border-top:solid;' );
-			} );
+					assertTRBLAttribute( tableCell, 'borderColor', null, null, null, '#f00' );
+					assertTRBLAttribute( tableCell, 'borderStyle', null, null, null, 'solid' );
+					assertTRBLAttribute( tableCell, 'borderWidth', null, null, null, '1px' );
+				} );
 
-			it( 'should downcast borderStyle attribute (different top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'borderStyle', {
-					top: 'solid',
-					right: 'ridge',
-					bottom: 'dotted',
-					left: 'dashed'
-				}, tableCell ) );
+				it( 'should allow to be overriden (only border-top consumed)', () => {
+					editor.conversion.for( 'upcast' ).add( dispatcher => dispatcher.on( 'element:td', ( evt, data, conversionApi ) => {
+						conversionApi.consumable.consume( data.viewItem, {
+							styles: [ 'border-top' ]
+						} );
+					}, { priority: 'high' } ) );
 
-				assertTableCellStyle( editor, 'border-bottom:dotted;border-left:dashed;border-right:ridge;border-top:solid;' );
-			} );
+					editor.setData( '<table><tr><td style="border:1px solid blue;">foo</td></tr></table>' );
 
-			it( 'should downcast borderWidth attribute (same top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'borderWidth', {
-					top: '42px',
-					right: '.1em',
-					bottom: '1337rem',
-					left: 'thick'
-				}, tableCell ) );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				assertTableCellStyle( editor, 'border-bottom:1337rem;border-left:thick;border-right:.1em;border-top:42px;' );
+					expect( tableCell.getAttribute( 'borderColor' ) ).to.be.undefined;
+					expect( tableCell.getAttribute( 'borderStyle' ) ).to.be.undefined;
+					expect( tableCell.getAttribute( 'borderWidth' ) ).to.be.undefined;
+				} );
 			} );
 
-			it( 'should downcast borderWidth attribute (different top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'borderWidth', {
-					top: '42px',
-					right: '42px',
-					bottom: '42px',
-					left: '42px'
-				}, tableCell ) );
+			describe( 'downcast conversion', () => {
+				let tableCell;
 
-				assertTableCellStyle( editor, 'border-bottom:42px;border-left:42px;border-right:42px;border-top:42px;' );
-			} );
+				beforeEach( () => {
+					setModelData(
+						model,
+						'<table headingRows="0" headingColumns="0">' +
+							'<tableRow>' +
+								'<tableCell>' +
+									'<paragraph>foo</paragraph>' +
+								'</tableCell>' +
+							'</tableRow>' +
+						'</table>'
+					);
+					tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				} );
 
-			it( 'should downcast borderColor, borderStyle and borderWidth attributes together (same top, right, bottom, left)', () => {
-				model.change( writer => {
-					writer.setAttribute( 'borderColor', {
+				it( 'should downcast borderColor attribute (same top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'borderColor', {
 						top: '#f00',
 						right: '#f00',
 						bottom: '#f00',
 						left: '#f00'
-					}, tableCell );
-
-					writer.setAttribute( 'borderStyle', {
-						top: 'solid',
-						right: 'solid',
-						bottom: 'solid',
-						left: 'solid'
-					}, tableCell );
+					}, tableCell ) );
 
-					writer.setAttribute( 'borderWidth', {
-						top: '42px',
-						right: '42px',
-						bottom: '42px',
-						left: '42px'
-					}, tableCell );
+					assertTableCellStyle( editor, 'border-bottom:#f00;border-left:#f00;border-right:#f00;border-top:#f00;' );
 				} );
 
-				assertTableCellStyle( editor,
-					'border-bottom:42px solid #f00;' +
-					'border-left:42px solid #f00;' +
-					'border-right:42px solid #f00;' +
-					'border-top:42px solid #f00;'
-				);
-			} );
-
-			it( 'should downcast borderColor, borderStyle and borderWidth attributes together (different top, right, bottom, left)', () => {
-				model.change( writer => {
-					writer.setAttribute( 'borderColor', {
+				it( 'should downcast borderColor attribute (different top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'borderColor', {
 						top: '#f00',
 						right: 'hsla(0, 100%, 50%, 0.5)',
 						bottom: 'deeppink',
 						left: 'rgb(255, 0, 0)'
-					}, tableCell );
+					}, tableCell ) );
+
+					assertTableCellStyle( editor,
+						'border-bottom:deeppink;' +
+						'border-left:rgb(255, 0, 0);' +
+						'border-right:hsla(0, 100%, 50%, 0.5);' +
+						'border-top:#f00;'
+					);
+				} );
+
+				it( 'should downcast borderStyle attribute (same top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'borderStyle', {
+						top: 'solid',
+						right: 'solid',
+						bottom: 'solid',
+						left: 'solid'
+					}, tableCell ) );
+
+					assertTableCellStyle( editor, 'border-bottom:solid;border-left:solid;border-right:solid;border-top:solid;' );
+				} );
 
-					writer.setAttribute( 'borderStyle', {
+				it( 'should downcast borderStyle attribute (different top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'borderStyle', {
 						top: 'solid',
 						right: 'ridge',
 						bottom: 'dotted',
 						left: 'dashed'
-					}, tableCell );
+					}, tableCell ) );
+
+					assertTableCellStyle( editor, 'border-bottom:dotted;border-left:dashed;border-right:ridge;border-top:solid;' );
+				} );
 
-					writer.setAttribute( 'borderWidth', {
+				it( 'should downcast borderWidth attribute (same top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'borderWidth', {
 						top: '42px',
 						right: '.1em',
 						bottom: '1337rem',
 						left: 'thick'
-					}, tableCell );
+					}, tableCell ) );
+
+					assertTableCellStyle( editor, 'border-bottom:1337rem;border-left:thick;border-right:.1em;border-top:42px;' );
 				} );
 
-				assertTableCellStyle( editor,
-					'border-bottom:1337rem dotted deeppink;' +
-					'border-left:thick dashed rgb(255, 0, 0);' +
-					'border-right:.1em ridge hsla(0, 100%, 50%, 0.5);' +
-					'border-top:42px solid #f00;'
-				);
-			} );
+				it( 'should downcast borderWidth attribute (different top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'borderWidth', {
+						top: '42px',
+						right: '42px',
+						bottom: '42px',
+						left: '42px'
+					}, tableCell ) );
 
-			describe( 'change attribute', () => {
-				beforeEach( () => {
+					assertTableCellStyle( editor, 'border-bottom:42px;border-left:42px;border-right:42px;border-top:42px;' );
+				} );
+
+				it( 'should downcast borderColor, borderStyle and borderWidth attributes together (same top, right, bottom, left)', () => {
 					model.change( writer => {
 						writer.setAttribute( 'borderColor', {
 							top: '#f00',
@@ -375,398 +361,467 @@ describe( 'TableCellPropertiesEditing', () => {
 							left: '42px'
 						}, tableCell );
 					} );
-				} );
-
-				it( 'should downcast borderColor attribute change', () => {
-					model.change( writer => writer.setAttribute( 'borderColor', {
-						top: 'deeppink',
-						right: 'deeppink',
-						bottom: 'deeppink',
-						left: 'deeppink'
-					}, tableCell ) );
 
 					assertTableCellStyle( editor,
-						'border-bottom:42px solid deeppink;' +
-						'border-left:42px solid deeppink;' +
-						'border-right:42px solid deeppink;' +
-						'border-top:42px solid deeppink;'
+						'border-bottom:42px solid #f00;' +
+						'border-left:42px solid #f00;' +
+						'border-right:42px solid #f00;' +
+						'border-top:42px solid #f00;'
 					);
 				} );
 
-				it( 'should downcast borderStyle attribute change', () => {
-					model.change( writer => writer.setAttribute( 'borderStyle', {
-						top: 'ridge',
-						right: 'ridge',
-						bottom: 'ridge',
-						left: 'ridge'
-					}, tableCell ) );
+				it(
+					'should downcast borderColor, borderStyle and borderWidth attributes together (different top, right, bottom, left)',
+					() => {
+						model.change( writer => {
+							writer.setAttribute( 'borderColor', {
+								top: '#f00',
+								right: 'hsla(0, 100%, 50%, 0.5)',
+								bottom: 'deeppink',
+								left: 'rgb(255, 0, 0)'
+							}, tableCell );
+
+							writer.setAttribute( 'borderStyle', {
+								top: 'solid',
+								right: 'ridge',
+								bottom: 'dotted',
+								left: 'dashed'
+							}, tableCell );
+
+							writer.setAttribute( 'borderWidth', {
+								top: '42px',
+								right: '.1em',
+								bottom: '1337rem',
+								left: 'thick'
+							}, tableCell );
+						} );
+
+						assertTableCellStyle( editor,
+							'border-bottom:1337rem dotted deeppink;' +
+							'border-left:thick dashed rgb(255, 0, 0);' +
+							'border-right:.1em ridge hsla(0, 100%, 50%, 0.5);' +
+							'border-top:42px solid #f00;'
+						);
+					}
+				);
 
-					assertTableCellStyle( editor,
-						'border-bottom:42px ridge #f00;' +
-						'border-left:42px ridge #f00;' +
-						'border-right:42px ridge #f00;' +
-						'border-top:42px ridge #f00;'
-					);
-				} );
+				describe( 'change attribute', () => {
+					beforeEach( () => {
+						model.change( writer => {
+							writer.setAttribute( 'borderColor', {
+								top: '#f00',
+								right: '#f00',
+								bottom: '#f00',
+								left: '#f00'
+							}, tableCell );
+
+							writer.setAttribute( 'borderStyle', {
+								top: 'solid',
+								right: 'solid',
+								bottom: 'solid',
+								left: 'solid'
+							}, tableCell );
+
+							writer.setAttribute( 'borderWidth', {
+								top: '42px',
+								right: '42px',
+								bottom: '42px',
+								left: '42px'
+							}, tableCell );
+						} );
+					} );
 
-				it( 'should downcast borderWidth attribute change', () => {
-					model.change( writer => writer.setAttribute( 'borderWidth', {
-						top: 'thick',
-						right: 'thick',
-						bottom: 'thick',
-						left: 'thick'
-					}, tableCell ) );
+					it( 'should downcast borderColor attribute change', () => {
+						model.change( writer => writer.setAttribute( 'borderColor', {
+							top: 'deeppink',
+							right: 'deeppink',
+							bottom: 'deeppink',
+							left: 'deeppink'
+						}, tableCell ) );
+
+						assertTableCellStyle( editor,
+							'border-bottom:42px solid deeppink;' +
+							'border-left:42px solid deeppink;' +
+							'border-right:42px solid deeppink;' +
+							'border-top:42px solid deeppink;'
+						);
+					} );
 
-					assertTableCellStyle( editor,
-						'border-bottom:thick solid #f00;' +
-						'border-left:thick solid #f00;' +
-						'border-right:thick solid #f00;' +
-						'border-top:thick solid #f00;'
-					);
-				} );
+					it( 'should downcast borderStyle attribute change', () => {
+						model.change( writer => writer.setAttribute( 'borderStyle', {
+							top: 'ridge',
+							right: 'ridge',
+							bottom: 'ridge',
+							left: 'ridge'
+						}, tableCell ) );
+
+						assertTableCellStyle( editor,
+							'border-bottom:42px ridge #f00;' +
+							'border-left:42px ridge #f00;' +
+							'border-right:42px ridge #f00;' +
+							'border-top:42px ridge #f00;'
+						);
+					} );
 
-				it( 'should downcast borderColor attribute removal', () => {
-					model.change( writer => writer.removeAttribute( 'borderColor', tableCell ) );
+					it( 'should downcast borderWidth attribute change', () => {
+						model.change( writer => writer.setAttribute( 'borderWidth', {
+							top: 'thick',
+							right: 'thick',
+							bottom: 'thick',
+							left: 'thick'
+						}, tableCell ) );
+
+						assertTableCellStyle( editor,
+							'border-bottom:thick solid #f00;' +
+							'border-left:thick solid #f00;' +
+							'border-right:thick solid #f00;' +
+							'border-top:thick solid #f00;'
+						);
+					} );
 
-					assertTableCellStyle( editor,
-						'border-bottom:42px solid;' +
-						'border-left:42px solid;' +
-						'border-right:42px solid;' +
-						'border-top:42px solid;'
-					);
-				} );
+					it( 'should downcast borderColor attribute removal', () => {
+						model.change( writer => writer.removeAttribute( 'borderColor', tableCell ) );
 
-				it( 'should downcast borderStyle attribute removal', () => {
-					model.change( writer => writer.removeAttribute( 'borderStyle', tableCell ) );
+						assertTableCellStyle( editor,
+							'border-bottom:42px solid;' +
+							'border-left:42px solid;' +
+							'border-right:42px solid;' +
+							'border-top:42px solid;'
+						);
+					} );
 
-					assertTableCellStyle( editor,
-						'border-bottom:42px #f00;' +
-						'border-left:42px #f00;' +
-						'border-right:42px #f00;' +
-						'border-top:42px #f00;'
-					);
-				} );
+					it( 'should downcast borderStyle attribute removal', () => {
+						model.change( writer => writer.removeAttribute( 'borderStyle', tableCell ) );
 
-				it( 'should downcast borderWidth attribute removal', () => {
-					model.change( writer => writer.removeAttribute( 'borderWidth', tableCell ) );
+						assertTableCellStyle( editor,
+							'border-bottom:42px #f00;' +
+							'border-left:42px #f00;' +
+							'border-right:42px #f00;' +
+							'border-top:42px #f00;'
+						);
+					} );
 
-					assertTableCellStyle( editor,
-						'border-bottom:solid #f00;' +
-						'border-left:solid #f00;' +
-						'border-right:solid #f00;' +
-						'border-top:solid #f00;'
-					);
-				} );
+					it( 'should downcast borderWidth attribute removal', () => {
+						model.change( writer => writer.removeAttribute( 'borderWidth', tableCell ) );
 
-				it( 'should downcast borderColor, borderStyle and borderWidth attributes removal', () => {
-					model.change( writer => {
-						writer.removeAttribute( 'borderColor', tableCell );
-						writer.removeAttribute( 'borderStyle', tableCell );
-						writer.removeAttribute( 'borderWidth', tableCell );
+						assertTableCellStyle( editor,
+							'border-bottom:solid #f00;' +
+							'border-left:solid #f00;' +
+							'border-right:solid #f00;' +
+							'border-top:solid #f00;'
+						);
 					} );
 
-					assertEqualMarkup(
-						editor.getData(),
-						'<figure class="table"><table><tbody><tr><td>foo</td></tr></tbody></table></figure>'
-					);
+					it( 'should downcast borderColor, borderStyle and borderWidth attributes removal', () => {
+						model.change( writer => {
+							writer.removeAttribute( 'borderColor', tableCell );
+							writer.removeAttribute( 'borderStyle', tableCell );
+							writer.removeAttribute( 'borderWidth', tableCell );
+						} );
+
+						assertEqualMarkup(
+							editor.getData(),
+							'<figure class="table"><table><tbody><tr><td>foo</td></tr></tbody></table></figure>'
+						);
+					} );
 				} );
 			} );
 		} );
-	} );
 
-	describe( 'background color', () => {
-		it( 'should set proper schema rules', () => {
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'backgroundColor' ) ).to.be.true;
-		} );
+		describe( 'background color', () => {
+			it( 'should set proper schema rules', () => {
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'backgroundColor' ) ).to.be.true;
+			} );
 
-		describe( 'upcast conversion', () => {
-			it( 'should upcast background-color', () => {
-				editor.setData( '<table><tr><td style="background-color:#f00">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+			describe( 'upcast conversion', () => {
+				it( 'should upcast background-color', () => {
+					editor.setData( '<table><tr><td style="background-color:#f00">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				expect( tableCell.getAttribute( 'backgroundColor' ) ).to.equal( '#f00' );
+					expect( tableCell.getAttribute( 'backgroundColor' ) ).to.equal( '#f00' );
+				} );
 			} );
-		} );
 
-		describe( 'downcast conversion', () => {
-			let tableCell;
-
-			beforeEach( () => {
-				setModelData(
-					model,
-					'<table headingRows="0" headingColumns="0">' +
-						'<tableRow>' +
-							'<tableCell>' +
-								'<paragraph>foo</paragraph>' +
-							'</tableCell>' +
-						'</tableRow>' +
-					'</table>'
-				);
-				tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
-			} );
+			describe( 'downcast conversion', () => {
+				let tableCell;
 
-			it( 'should downcast backgroundColor', () => {
-				model.change( writer => writer.setAttribute( 'backgroundColor', '#f00', tableCell ) );
+				beforeEach( () => {
+					setModelData(
+						model,
+						'<table headingRows="0" headingColumns="0">' +
+							'<tableRow>' +
+								'<tableCell>' +
+									'<paragraph>foo</paragraph>' +
+								'</tableCell>' +
+							'</tableRow>' +
+						'</table>'
+					);
+					tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				} );
 
-				assertTableCellStyle( editor, 'background-color:#f00;' );
-			} );
-		} );
-	} );
+				it( 'should downcast backgroundColor', () => {
+					model.change( writer => writer.setAttribute( 'backgroundColor', '#f00', tableCell ) );
 
-	describe( 'horizontal alignment', () => {
-		it( 'should set proper schema rules', () => {
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'horizontalAlignment' ) ).to.be.true;
+					assertTableCellStyle( editor, 'background-color:#f00;' );
+				} );
+			} );
 		} );
 
-		describe( 'upcast conversion', () => {
-			it( 'should upcast text-align:left style', () => {
-				editor.setData( '<table><tr><td style="text-align:left">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
-
-				expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'left' );
+		describe( 'horizontal alignment', () => {
+			it( 'should set proper schema rules', () => {
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'horizontalAlignment' ) ).to.be.true;
 			} );
 
-			it( 'should upcast text-align:right style', () => {
-				editor.setData( '<table><tr><td style="text-align:right">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+			describe( 'upcast conversion', () => {
+				it( 'should upcast text-align:left style', () => {
+					editor.setData( '<table><tr><td style="text-align:left">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'right' );
-			} );
+					expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'left' );
+				} );
 
-			it( 'should upcast text-align:center style', () => {
-				editor.setData( '<table><tr><td style="text-align:center">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should upcast text-align:right style', () => {
+					editor.setData( '<table><tr><td style="text-align:right">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'center' );
-			} );
-
-			it( 'should upcast text-align:justify style', () => {
-				editor.setData( '<table><tr><td style="text-align:justify">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+					expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'right' );
+				} );
 
-				expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'justify' );
-			} );
-		} );
+				it( 'should upcast text-align:center style', () => {
+					editor.setData( '<table><tr><td style="text-align:center">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-		describe( 'downcast conversion', () => {
-			let tableCell;
-
-			beforeEach( () => {
-				setModelData(
-					model,
-					'<table headingRows="0" headingColumns="0">' +
-						'<tableRow>' +
-							'<tableCell>' +
-								'<paragraph>foo</paragraph>' +
-							'</tableCell>' +
-						'</tableRow>' +
-					'</table>'
-				);
-				tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
-			} );
+					expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'center' );
+				} );
 
-			it( 'should downcast horizontalAlignment=left', () => {
-				model.change( writer => writer.setAttribute( 'horizontalAlignment', 'left', tableCell ) );
+				it( 'should upcast text-align:justify style', () => {
+					editor.setData( '<table><tr><td style="text-align:justify">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				assertTableCellStyle( editor, 'text-align:left;' );
+					expect( tableCell.getAttribute( 'horizontalAlignment' ) ).to.equal( 'justify' );
+				} );
 			} );
 
-			it( 'should downcast horizontalAlignment=right', () => {
-				model.change( writer => writer.setAttribute( 'horizontalAlignment', 'right', tableCell ) );
+			describe( 'downcast conversion', () => {
+				let tableCell;
 
-				assertTableCellStyle( editor, 'text-align:right;' );
-			} );
+				beforeEach( () => {
+					setModelData(
+						model,
+						'<table headingRows="0" headingColumns="0">' +
+							'<tableRow>' +
+								'<tableCell>' +
+									'<paragraph>foo</paragraph>' +
+								'</tableCell>' +
+							'</tableRow>' +
+						'</table>'
+					);
+					tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				} );
 
-			it( 'should downcast horizontalAlignment=center', () => {
-				model.change( writer => writer.setAttribute( 'horizontalAlignment', 'center', tableCell ) );
+				it( 'should downcast horizontalAlignment=left', () => {
+					model.change( writer => writer.setAttribute( 'horizontalAlignment', 'left', tableCell ) );
 
-				assertTableCellStyle( editor, 'text-align:center;' );
-			} );
+					assertTableCellStyle( editor, 'text-align:left;' );
+				} );
 
-			it( 'should downcast horizontalAlignment=justify', () => {
-				model.change( writer => writer.setAttribute( 'horizontalAlignment', 'justify', tableCell ) );
+				it( 'should downcast horizontalAlignment=right', () => {
+					model.change( writer => writer.setAttribute( 'horizontalAlignment', 'right', tableCell ) );
 
-				assertTableCellStyle( editor, 'text-align:justify;' );
-			} );
-		} );
-	} );
+					assertTableCellStyle( editor, 'text-align:right;' );
+				} );
 
-	describe( 'vertical alignment', () => {
-		it( 'should set proper schema rules', () => {
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'verticalAlignment' ) ).to.be.true;
-		} );
+				it( 'should downcast horizontalAlignment=center', () => {
+					model.change( writer => writer.setAttribute( 'horizontalAlignment', 'center', tableCell ) );
 
-		describe( 'upcast conversion', () => {
-			it( 'should upcast vertical-align', () => {
-				editor.setData( '<table><tr><td style="vertical-align:top">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+					assertTableCellStyle( editor, 'text-align:center;' );
+				} );
+
+				it( 'should downcast horizontalAlignment=justify', () => {
+					model.change( writer => writer.setAttribute( 'horizontalAlignment', 'justify', tableCell ) );
 
-				expect( tableCell.getAttribute( 'verticalAlignment' ) ).to.equal( 'top' );
+					assertTableCellStyle( editor, 'text-align:justify;' );
+				} );
 			} );
 		} );
 
-		describe( 'downcast conversion', () => {
-			let tableCell;
-
-			beforeEach( () => {
-				setModelData(
-					model,
-					'<table headingRows="0" headingColumns="0">' +
-						'<tableRow>' +
-							'<tableCell>' +
-								'<paragraph>foo</paragraph>' +
-							'</tableCell>' +
-						'</tableRow>' +
-					'</table>'
-				);
-				tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+		describe( 'vertical alignment', () => {
+			it( 'should set proper schema rules', () => {
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'verticalAlignment' ) ).to.be.true;
 			} );
 
-			it( 'should downcast verticalAlignment', () => {
-				model.change( writer => writer.setAttribute( 'verticalAlignment', 'middle', tableCell ) );
+			describe( 'upcast conversion', () => {
+				it( 'should upcast vertical-align', () => {
+					editor.setData( '<table><tr><td style="vertical-align:top">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				assertTableCellStyle( editor, 'vertical-align:middle;' );
+					expect( tableCell.getAttribute( 'verticalAlignment' ) ).to.equal( 'top' );
+				} );
 			} );
-		} );
-	} );
 
-	describe( 'padding', () => {
-		it( 'should set proper schema rules', () => {
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'padding' ) ).to.be.true;
-		} );
+			describe( 'downcast conversion', () => {
+				let tableCell;
+
+				beforeEach( () => {
+					setModelData(
+						model,
+						'<table headingRows="0" headingColumns="0">' +
+							'<tableRow>' +
+								'<tableCell>' +
+									'<paragraph>foo</paragraph>' +
+								'</tableCell>' +
+							'</tableRow>' +
+						'</table>'
+					);
+					tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				} );
 
-		describe( 'upcast conversion', () => {
-			it( 'should upcast padding shorthand', () => {
-				editor.setData( '<table><tr><td style="padding:2px 4em">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should downcast verticalAlignment', () => {
+					model.change( writer => writer.setAttribute( 'verticalAlignment', 'middle', tableCell ) );
 
-				assertTRBLAttribute( tableCell, 'padding', '2px', '4em' );
+					assertTableCellStyle( editor, 'vertical-align:middle;' );
+				} );
 			} );
 		} );
 
-		describe( 'downcast conversion', () => {
-			let tableCell;
-
-			beforeEach( () => {
-				setModelData(
-					model,
-					'<table headingRows="0" headingColumns="0">' +
-						'<tableRow>' +
-							'<tableCell>' +
-								'<paragraph>foo</paragraph>' +
-							'</tableCell>' +
-						'</tableRow>' +
-					'</table>'
-				);
-				tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+		describe( 'padding', () => {
+			it( 'should set proper schema rules', () => {
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'padding' ) ).to.be.true;
 			} );
 
-			it( 'should downcast padding (same top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'padding', {
-					top: '2px',
-					right: '2px',
-					bottom: '2px',
-					left: '2px'
-				}, tableCell ) );
+			describe( 'upcast conversion', () => {
+				it( 'should upcast padding shorthand', () => {
+					editor.setData( '<table><tr><td style="padding:2px 4em">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				assertTableCellStyle( editor, 'padding:2px;' );
+					assertTRBLAttribute( tableCell, 'padding', '2px', '4em' );
+				} );
 			} );
 
-			it( 'should downcast padding (different top, right, bottom, left)', () => {
-				model.change( writer => writer.setAttribute( 'padding', {
-					top: '2px',
-					right: '3px',
-					bottom: '4px',
-					left: '5px'
-				}, tableCell ) );
+			describe( 'downcast conversion', () => {
+				let tableCell;
 
-				assertTableCellStyle( editor, 'padding:2px 3px 4px 5px;' );
-			} );
-		} );
-	} );
+				beforeEach( () => {
+					setModelData(
+						model,
+						'<table headingRows="0" headingColumns="0">' +
+							'<tableRow>' +
+								'<tableCell>' +
+									'<paragraph>foo</paragraph>' +
+								'</tableCell>' +
+							'</tableRow>' +
+						'</table>'
+					);
+					tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				} );
 
-	describe( 'cell width', () => {
-		it( 'should set proper schema rules', () => {
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'width' ) ).to.be.true;
-		} );
+				it( 'should downcast padding (same top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'padding', {
+						top: '2px',
+						right: '2px',
+						bottom: '2px',
+						left: '2px'
+					}, tableCell ) );
 
-		describe( 'upcast conversion', () => {
-			it( 'should upcast width attribute on table cell', () => {
-				editor.setData( '<table><tr><td style="width:20px">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+					assertTableCellStyle( editor, 'padding:2px;' );
+				} );
 
-				expect( tableCell.getAttribute( 'width' ) ).to.equal( '20px' );
+				it( 'should downcast padding (different top, right, bottom, left)', () => {
+					model.change( writer => writer.setAttribute( 'padding', {
+						top: '2px',
+						right: '3px',
+						bottom: '4px',
+						left: '5px'
+					}, tableCell ) );
+
+					assertTableCellStyle( editor, 'padding:2px 3px 4px 5px;' );
+				} );
 			} );
 		} );
 
-		describe( 'downcast conversion', () => {
-			let tableCell;
-
-			beforeEach( () => {
-				setModelData(
-					model,
-					'<table headingRows="0" headingColumns="0">' +
-						'<tableRow>' +
-							'<tableCell>' +
-								'<paragraph>foo</paragraph>' +
-							'</tableCell>' +
-						'</tableRow>' +
-					'</table>'
-				);
-
-				tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+		describe( 'cell width', () => {
+			it( 'should set proper schema rules', () => {
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'width' ) ).to.be.true;
 			} );
 
-			it( 'should downcast width attribute', () => {
-				model.change( writer => writer.setAttribute( 'width', '20px', tableCell ) );
+			describe( 'upcast conversion', () => {
+				it( 'should upcast width attribute on table cell', () => {
+					editor.setData( '<table><tr><td style="width:20px">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
 
-				assertEqualMarkup(
-					editor.getData(),
-					'<figure class="table"><table><tbody><tr><td style="width:20px;">foo</td></tr></tbody></table></figure>'
-				);
+					expect( tableCell.getAttribute( 'width' ) ).to.equal( '20px' );
+				} );
 			} );
-		} );
-	} );
 
-	describe( 'cell height', () => {
-		it( 'should set proper schema rules', () => {
-			expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'height' ) ).to.be.true;
-		} );
+			describe( 'downcast conversion', () => {
+				let tableCell;
+
+				beforeEach( () => {
+					setModelData(
+						model,
+						'<table headingRows="0" headingColumns="0">' +
+							'<tableRow>' +
+								'<tableCell>' +
+									'<paragraph>foo</paragraph>' +
+								'</tableCell>' +
+							'</tableRow>' +
+						'</table>'
+					);
+
+					tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				} );
 
-		describe( 'upcast conversion', () => {
-			it( 'should upcast height attribute on table cell', () => {
-				editor.setData( '<table><tr><td style="height:20px">foo</td></tr></table>' );
-				const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				it( 'should downcast width attribute', () => {
+					model.change( writer => writer.setAttribute( 'width', '20px', tableCell ) );
 
-				expect( tableCell.getAttribute( 'height' ) ).to.equal( '20px' );
+					assertEqualMarkup(
+						editor.getData(),
+						'<figure class="table"><table><tbody><tr><td style="width:20px;">foo</td></tr></tbody></table></figure>'
+					);
+				} );
 			} );
 		} );
 
-		describe( 'downcast conversion', () => {
-			let tableCell;
-
-			beforeEach( () => {
-				setModelData(
-					model,
-					'<table headingRows="0" headingColumns="0">' +
-						'<tableRow>' +
-							'<tableCell>' +
-								'<paragraph>foo</paragraph>' +
-							'</tableCell>' +
-						'</tableRow>' +
-					'</table>'
-				);
+		describe( 'cell height', () => {
+			it( 'should set proper schema rules', () => {
+				expect( model.schema.checkAttribute( [ '$root', 'tableCell' ], 'height' ) ).to.be.true;
+			} );
 
-				tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+			describe( 'upcast conversion', () => {
+				it( 'should upcast height attribute on table cell', () => {
+					editor.setData( '<table><tr><td style="height:20px">foo</td></tr></table>' );
+					const tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+
+					expect( tableCell.getAttribute( 'height' ) ).to.equal( '20px' );
+				} );
 			} );
 
-			it( 'should downcast height attribute', () => {
-				model.change( writer => writer.setAttribute( 'height', '20px', tableCell ) );
+			describe( 'downcast conversion', () => {
+				let tableCell;
 
-				assertEqualMarkup(
-					editor.getData(),
-					'<figure class="table"><table><tbody><tr><td style="height:20px;">foo</td></tr></tbody></table></figure>'
-				);
+				beforeEach( () => {
+					setModelData(
+						model,
+						'<table headingRows="0" headingColumns="0">' +
+							'<tableRow>' +
+								'<tableCell>' +
+									'<paragraph>foo</paragraph>' +
+								'</tableCell>' +
+							'</tableRow>' +
+						'</table>'
+					);
+
+					tableCell = model.document.getRoot().getNodeByPath( [ 0, 0, 0 ] );
+				} );
+
+				it( 'should downcast height attribute', () => {
+					model.change( writer => writer.setAttribute( 'height', '20px', tableCell ) );
+
+					assertEqualMarkup(
+						editor.getData(),
+						'<figure class="table"><table><tbody><tr><td style="height:20px;">foo</td></tr></tbody></table></figure>'
+					);
+				} );
 			} );
 		} );
 	} );