|
@@ -133,11 +133,15 @@ describe( 'Table post-fixer', () => {
|
|
|
[ '21', '22' ]
|
|
[ '21', '22' ]
|
|
|
] );
|
|
] );
|
|
|
const tableB = modelTable( [
|
|
const tableB = modelTable( [
|
|
|
- [ 'aa' ],
|
|
|
|
|
|
|
+ [ 'aa', 'ab' ],
|
|
|
[ 'ba', 'bb' ]
|
|
[ 'ba', 'bb' ]
|
|
|
] );
|
|
] );
|
|
|
|
|
+ const tableC = modelTable( [
|
|
|
|
|
+ [ 'xx' ],
|
|
|
|
|
+ [ 'yy', 'yy' ]
|
|
|
|
|
+ ] );
|
|
|
|
|
|
|
|
- const parsed = parse( tableA + tableB, model.schema );
|
|
|
|
|
|
|
+ const parsed = parse( tableA + tableB + tableC, model.schema );
|
|
|
|
|
|
|
|
model.change( writer => {
|
|
model.change( writer => {
|
|
|
writer.remove( Range.createIn( root ) );
|
|
writer.remove( Range.createIn( root ) );
|
|
@@ -149,11 +153,17 @@ describe( 'Table post-fixer', () => {
|
|
|
[ '21', '22' ]
|
|
[ '21', '22' ]
|
|
|
] );
|
|
] );
|
|
|
const expectedTableB = formattedModelTable( [
|
|
const expectedTableB = formattedModelTable( [
|
|
|
- [ 'aa', '' ],
|
|
|
|
|
|
|
+ [ 'aa', 'ab' ],
|
|
|
[ 'ba', 'bb' ]
|
|
[ 'ba', 'bb' ]
|
|
|
] );
|
|
] );
|
|
|
|
|
+ const expectedTableC = formattedModelTable( [
|
|
|
|
|
+ [ 'xx', '' ],
|
|
|
|
|
+ [ 'yy', 'yy' ]
|
|
|
|
|
+ ] );
|
|
|
|
|
+
|
|
|
|
|
+ const expectedTables = expectedTableA + expectedTableB + expectedTableC;
|
|
|
|
|
|
|
|
- expect( formatTable( getModelData( model, { withoutSelection: true } ) ) ).to.equal( expectedTableA + expectedTableB );
|
|
|
|
|
|
|
+ expect( formatTable( getModelData( model, { withoutSelection: true } ) ) ).to.equal( expectedTables );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should not crash on table remove', () => {
|
|
it( 'should not crash on table remove', () => {
|