|
@@ -95,30 +95,30 @@ describe( 'Table feature – integration', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'fixing empty roots should be transparent to undo', () => {
|
|
it( 'fixing empty roots should be transparent to undo', () => {
|
|
|
- expect( editor.getData() ).to.equal( '<p> </p>' );
|
|
|
|
|
|
|
+ expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p> </p>' );
|
|
|
expect( editor.commands.get( 'undo' ).isEnabled ).to.be.false;
|
|
expect( editor.commands.get( 'undo' ).isEnabled ).to.be.false;
|
|
|
|
|
|
|
|
editor.data.set( viewTable( [ [ 'foo' ] ] ) );
|
|
editor.data.set( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
|
- expect( editor.getData() ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
+ expect( editor.getData( { trim: 'none' } ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
|
editor.model.change( writer => {
|
|
editor.model.change( writer => {
|
|
|
writer.remove( root.getChild( 0 ) );
|
|
writer.remove( root.getChild( 0 ) );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- expect( editor.getData() ).to.equal( '<p> </p>' );
|
|
|
|
|
|
|
+ expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p> </p>' );
|
|
|
|
|
|
|
|
editor.execute( 'undo' );
|
|
editor.execute( 'undo' );
|
|
|
|
|
|
|
|
- expect( editor.getData() ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
+ expect( editor.getData( { trim: 'none' } ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
|
editor.execute( 'redo' );
|
|
editor.execute( 'redo' );
|
|
|
|
|
|
|
|
- expect( editor.getData() ).to.equal( '<p> </p>' );
|
|
|
|
|
|
|
+ expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p> </p>' );
|
|
|
|
|
|
|
|
editor.execute( 'undo' );
|
|
editor.execute( 'undo' );
|
|
|
|
|
|
|
|
- expect( editor.getData() ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
+ expect( editor.getData( { trim: 'none' } ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'fixing empty roots should be transparent to undo - multiple roots', () => {
|
|
it( 'fixing empty roots should be transparent to undo - multiple roots', () => {
|
|
@@ -135,18 +135,18 @@ describe( 'Table feature – integration', () => {
|
|
|
writer.remove( otherRoot.getChild( 0 ) );
|
|
writer.remove( otherRoot.getChild( 0 ) );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- expect( editor.data.get( 'main' ) ).to.equal( '<p> </p>' );
|
|
|
|
|
- expect( editor.data.get( 'otherRoot' ) ).to.equal( '<p> </p>' );
|
|
|
|
|
|
|
+ expect( editor.data.get( { trim: 'none', rootName: 'main' } ) ).to.equal( '<p> </p>' );
|
|
|
|
|
+ expect( editor.data.get( { trim: 'none', rootName: 'otherRoot' } ) ).to.equal( '<p> </p>' );
|
|
|
|
|
|
|
|
editor.execute( 'undo' );
|
|
editor.execute( 'undo' );
|
|
|
|
|
|
|
|
- expect( editor.data.get( 'main' ) ).to.equal( '<p> </p>' );
|
|
|
|
|
- expect( editor.data.get( 'otherRoot' ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
+ expect( editor.data.get( { trim: 'none', rootName: 'main' } ) ).to.equal( '<p> </p>' );
|
|
|
|
|
+ expect( editor.data.get( { trim: 'none', rootName: 'otherRoot' } ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
|
editor.execute( 'undo' );
|
|
editor.execute( 'undo' );
|
|
|
|
|
|
|
|
- expect( editor.data.get( 'main' ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
- expect( editor.data.get( 'otherRoot' ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
|
|
+ expect( editor.data.get( { trim: 'none', rootName: 'main' } ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
|
|
+ expect( editor.data.get( { trim: 'none', rootName: 'otherRoot' } ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|