8
0
Просмотр исходного кода

Tests: Fix table post fixer tests for changes in tests utils.

Maciej Gołaszewski 7 лет назад
Родитель
Сommit
68a0914423

+ 3 - 1
packages/ckeditor5-table/src/converters/table-post-fixer.js

@@ -304,7 +304,9 @@ function fixTableRowsSizes( table, writer ) {
 
 			if ( columnsToInsert ) {
 				for ( let i = 0; i < columnsToInsert; i++ ) {
-					writer.insertElement( 'tableCell', Position.createAt( table.getChild( rowIndex ), 'end' ) );
+					const tableCell = writer.createElement( 'tableCell' );
+					writer.insert( tableCell, Position.createAt( table.getChild( rowIndex ), 'end' ) );
+					writer.insertElement( 'paragraph', tableCell );
 				}
 
 				wasFixed = true;

+ 0 - 1
packages/ckeditor5-table/src/converters/upcasttable.js

@@ -63,7 +63,6 @@ export default function upcastTable() {
 
 				const tableCell = conversionApi.writer.createElement( 'tableCell' );
 				conversionApi.writer.insert( tableCell, ModelPosition.createAt( row, 'end' ) );
-
 				conversionApi.writer.insertElement( 'paragraph', ModelPosition.createAt( tableCell, 'end' ) );
 			}
 

+ 5 - 2
packages/ckeditor5-table/tests/converters/table-post-fixer.js

@@ -421,7 +421,9 @@ describe( 'Table post-fixer', () => {
 			const table = root.getChild( 0 );
 			const tableRow = table.getChild( rowIndex );
 
-			writer.insertElement( 'tableCell', tableRow, index );
+			const tableCell = writer.createElement( 'tableCell' );
+			writer.insert( tableCell, tableRow, index );
+			writer.insertElement( 'paragraph', tableCell );
 		}
 
 		function _setAttribute( writer, attributeKey, attributeValue, path ) {
@@ -441,9 +443,10 @@ describe( 'Table post-fixer', () => {
 
 			for ( const index of rows ) {
 				const tableRow = table.getChild( index );
-				const tableCell = writer.createElement( 'tableCell' );
 
+				const tableCell = writer.createElement( 'tableCell' );
 				writer.insert( tableCell, tableRow, columnIndex );
+				writer.insertElement( 'paragraph', tableCell );
 			}
 		}
 	} );