|
|
@@ -58,6 +58,22 @@ describe( 'upcastTable()', () => {
|
|
|
expect( getModelData( model, { withoutSelection: true } ) ).to.equal( data );
|
|
|
}
|
|
|
|
|
|
+ it( 'should convert table figure', () => {
|
|
|
+ editor.setData(
|
|
|
+ '<figure class="table">' +
|
|
|
+ '<table>' +
|
|
|
+ '<tr><td>1</td></tr>' +
|
|
|
+ '</table>' +
|
|
|
+ '</figure>'
|
|
|
+ );
|
|
|
+
|
|
|
+ expectModel(
|
|
|
+ '<table>' +
|
|
|
+ '<tableRow><tableCell>1</tableCell></tableRow>' +
|
|
|
+ '</table>'
|
|
|
+ );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should create table model from table without thead', () => {
|
|
|
editor.setData(
|
|
|
'<table>' +
|
|
|
@@ -72,6 +88,28 @@ describe( 'upcastTable()', () => {
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
+ it( 'should not convert empty figure', () => {
|
|
|
+ '<figure class="table"></figure>';
|
|
|
+
|
|
|
+ expectModel( '' );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'should convert if figure do not have class="table" attribute', () => {
|
|
|
+ editor.setData(
|
|
|
+ '<figure>' +
|
|
|
+ '<table>' +
|
|
|
+ '<tr><td>1</td></tr>' +
|
|
|
+ '</table>' +
|
|
|
+ '</figure>'
|
|
|
+ );
|
|
|
+
|
|
|
+ expectModel(
|
|
|
+ '<table>' +
|
|
|
+ '<tableRow><tableCell>1</tableCell></tableRow>' +
|
|
|
+ '</table>'
|
|
|
+ );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should create table model from table with one thead with one row', () => {
|
|
|
editor.setData(
|
|
|
'<table>' +
|