Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #41 from ckeditor/t/ckeditor5/401
Browse files Browse the repository at this point in the history
Tests: Adjustments to changes in `getData()`.
  • Loading branch information
Reinmar committed Feb 14, 2019
2 parents dd3e0df + 6cc676f commit 0a9ace6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/paragraph-intergration.js
Expand Up @@ -148,7 +148,7 @@ describe( 'Paragraph feature – integration', () => {
const doc = editor.model.document;
const root = doc.getRoot();

expect( editor.getData() ).to.equal( '<p>&nbsp;</p>' );
expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p>&nbsp;</p>' );
expect( editor.commands.get( 'undo' ).isEnabled ).to.be.false;

editor.setData( '<p>Foobar.</p>' );
Expand All @@ -157,19 +157,19 @@ describe( 'Paragraph feature – integration', () => {
writer.remove( root.getChild( 0 ) );
} );

expect( editor.getData() ).to.equal( '<p>&nbsp;</p>' );
expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p>&nbsp;</p>' );

editor.execute( 'undo' );

expect( editor.getData() ).to.equal( '<p>Foobar.</p>' );
expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p>Foobar.</p>' );

editor.execute( 'redo' );

expect( editor.getData() ).to.equal( '<p>&nbsp;</p>' );
expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p>&nbsp;</p>' );

editor.execute( 'undo' );

expect( editor.getData() ).to.equal( '<p>Foobar.</p>' );
expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p>Foobar.</p>' );
} );
} );

Expand All @@ -193,18 +193,18 @@ describe( 'Paragraph feature – integration', () => {
writer.remove( otherRoot.getChild( 0 ) );
} );

expect( editor.data.get( 'main' ) ).to.equal( '<p>&nbsp;</p>' );
expect( editor.data.get( 'otherRoot' ) ).to.equal( '<p>&nbsp;</p>' );
expect( editor.data.get( { rootName: 'main', trim: 'none' } ) ).to.equal( '<p>&nbsp;</p>' );
expect( editor.data.get( { rootName: 'otherRoot', trim: 'none' } ) ).to.equal( '<p>&nbsp;</p>' );

editor.execute( 'undo' );

expect( editor.data.get( 'main' ) ).to.equal( '<p>&nbsp;</p>' );
expect( editor.data.get( 'otherRoot' ) ).to.equal( '<p>Foobar.</p>' );
expect( editor.data.get( { rootName: 'main', trim: 'none' } ) ).to.equal( '<p>&nbsp;</p>' );
expect( editor.data.get( { rootName: 'otherRoot', trim: 'none' } ) ).to.equal( '<p>Foobar.</p>' );

editor.execute( 'undo' );

expect( editor.data.get( 'main' ) ).to.equal( '<p>Foobar.</p>' );
expect( editor.data.get( 'otherRoot' ) ).to.equal( '<p>Foobar.</p>' );
expect( editor.data.get( { rootName: 'main', trim: 'none' } ) ).to.equal( '<p>Foobar.</p>' );
expect( editor.data.get( { rootName: 'otherRoot', trim: 'none' } ) ).to.equal( '<p>Foobar.</p>' );
} );
} );
} );
Expand Down

0 comments on commit 0a9ace6

Please sign in to comment.