From 512f13a03f530f64ad5c39360854c207763c45ca Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Fri, 13 Jan 2023 13:32:34 +0100 Subject: [PATCH] Add tests --- .../tablecolumnresizeediting.js | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/packages/ckeditor5-table/tests/tablecolumnresize/tablecolumnresizeediting.js b/packages/ckeditor5-table/tests/tablecolumnresize/tablecolumnresizeediting.js index fce4079d901..504f00b7dfe 100644 --- a/packages/ckeditor5-table/tests/tablecolumnresize/tablecolumnresizeediting.js +++ b/packages/ckeditor5-table/tests/tablecolumnresize/tablecolumnresizeediting.js @@ -11,6 +11,7 @@ import TableCaption from '../../src/tablecaption'; import TableToolbar from '../../src/tabletoolbar'; import Table from '../../src/table'; import TableProperties from '../../src/tableproperties'; +import PlainTableOutput from '../../src/plaintableoutput'; // ClassicTestEditor can't be used, as it doesn't handle the focus, which is needed to test resizer visual cues. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; @@ -2558,6 +2559,53 @@ describe( 'TableColumnResizeEditing', () => { expect( initialViewColumnWidthsPx ).to.deep.equal( finalViewColumnWidthsPx ); } ); } ); + + describe( 'PlainTableOutput', () => { + let ptoEditor; + + beforeEach( async () => { + ptoEditor = await createEditor( { + plugins: [ Table, TableColumnResize, Paragraph, PlainTableOutput ] + } ); + } ); + + afterEach( async () => { + await ptoEditor.destroy(); + } ); + + it( 'should not crash', () => { + const table = modelTable( + [ [ 'Some', 'Data' ] ], + { columnWidths: '80%,20%', tableWidth: '100%' } + ); + setModelData( ptoEditor.model, table ); + + expect( () => ptoEditor.getData() ).to.not.throw(); + } ); + + it( 'should produce table not wrapped in
', () => { + const table = modelTable( + [ [ 'Some', 'Data' ] ], + { columnWidths: '80%,20%', tableWidth: '100%' } + ); + setModelData( ptoEditor.model, table ); + + expect( ptoEditor.getData() ).to.equal( + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
SomeData
' + ); + } ); + } ); } ); async function createEditor( configCustomization, additionalPlugins ) {