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

Commit

Permalink
Tests: Use sample file for automated tests. See ckeditor/ckeditor5-de…
Browse files Browse the repository at this point in the history
…v#139.
  • Loading branch information
jodator committed Aug 1, 2019
2 parents 7dd8689 + ab5e5ea commit 7ed2745
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,27 @@ describe( 'Highlight', () => {

describe( 'compatibility with images', () => {
it( 'does work inside image caption', () => {
setModelData( model, '<image src="foo.png"><caption>foo[bar]baz</caption></image>' );
setModelData( model, '<image src="/assets/sample.png"><caption>foo[bar]baz</caption></image>' );

editor.execute( 'highlight', { value: 'yellowMarker' } );

expect( getModelData( model ) )
.to.equal( '<image src="foo.png"><caption>foo[<$text highlight="yellowMarker">bar</$text>]baz</caption></image>' );
.to.equal(
'<image src="/assets/sample.png"><caption>foo[<$text highlight="yellowMarker">bar</$text>]baz</caption></image>'
);
} );

it( 'does work on selection with image', () => {
setModelData(
model,
'<paragraph>foo[foo</paragraph><image src="foo.png"><caption>abc</caption></image><paragraph>bar]bar</paragraph>'
'<paragraph>foo[foo</paragraph><image src="/assets/sample.png"><caption>abc</caption></image><paragraph>bar]bar</paragraph>'
);

editor.execute( 'highlight', { value: 'yellowMarker' } );

expect( getModelData( model ) ).to.equal(
'<paragraph>foo[<$text highlight="yellowMarker">foo</$text></paragraph>' +
'<image src="foo.png"><caption><$text highlight="yellowMarker">abc</$text></caption></image>' +
'<image src="/assets/sample.png"><caption><$text highlight="yellowMarker">abc</$text></caption></image>' +
'<paragraph><$text highlight="yellowMarker">bar</$text>]bar</paragraph>'
);
} );
Expand Down

0 comments on commit 7ed2745

Please sign in to comment.