/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
import TableEditing from '../src/tableediting';
describe( 'TableEditing', () => {
let editor, model;
beforeEach( () => {
return VirtualTestEditor
.create( {
plugins: [ TableEditing, Paragraph ]
} )
.then( newEditor => {
editor = newEditor;
model = editor.model;
} );
} );
afterEach( () => {
editor.destroy();
} );
it( 'should set proper schema rules', () => {
} );
describe( 'conversion in data pipeline', () => {
describe( 'model to view', () => {
it( 'should create tbody section', () => {
setModelData( model, '
' );
expect( editor.getData() ).to.equal( '' );
} );
it( 'should create thead section', () => {
setModelData( model, '' );
expect( editor.getData() ).to.equal( '' );
} );
it( 'should create thead and tbody sections in proper order', () => {
setModelData( model, '' +
'foo' +
'bar' +
'baz[]' +
'
'
);
expect( editor.getData() ).to.equal( ''
);
} );
it( 'should convert rowspan on tableCell', () => {
setModelData( model, '' );
expect( editor.getData() ).to.equal( '' );
} );
it( 'should convert colspan on tableCell', () => {
setModelData( model, '' );
expect( editor.getData() ).to.equal( '' );
} );
} );
describe( 'view to model', () => {
it( 'should convert table', () => {
editor.setData( '' );
expect( getModelData( model, { withoutSelection: true } ) )
.to.equal( '' );
} );
} );
} );
} );