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

Commit

Permalink
Aligned tests to changes in "getData()" util. Read more https://githu…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Piechaczek committed Nov 16, 2017
1 parent 949c673 commit 9fc8f3d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 59 deletions.
12 changes: 6 additions & 6 deletions tests/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe( 'Image', () => {
setModelData( document, '[<image alt="alt text" src="foo.png"></image>]' );

expect( getViewData( viewDocument ) ).to.equal(
'[<figure class="image ck-widget ck-widget_selected" contenteditable="false">' +
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>]'
);
Expand All @@ -71,7 +71,7 @@ describe( 'Image', () => {
setModelData( document, '[<image src="foo.png" alt=""></image>]' );

expect( getViewData( viewDocument ) ).to.equal(
'[<figure class="image ck-widget ck-widget_selected" contenteditable="false">' +
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="" src="foo.png"></img>' +
'</figure>]'
);
Expand All @@ -87,10 +87,10 @@ describe( 'Image', () => {
);

expect( getViewData( viewDocument ) ).to.equal(
'[<figure class="image ck-widget ck-widget_selected" contenteditable="false">' +
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>]' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -101,10 +101,10 @@ describe( 'Image', () => {
} );

expect( getViewData( viewDocument ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>' +
'[<figure class="image ck-widget ck-widget_selected" contenteditable="false">' +
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>]'
);
Expand Down
8 changes: 4 additions & 4 deletions tests/image/converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe( 'Image converters', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
'<figure class="ck-widget image" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
);
} );

Expand All @@ -157,7 +157,7 @@ describe( 'Image converters', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img src=""></img></figure>'
'<figure class="ck-widget image" contenteditable="false"><img src=""></img></figure>'
);
} );

Expand All @@ -172,7 +172,7 @@ describe( 'Image converters', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img alt="baz quix" src=""></img></figure>'
'<figure class="ck-widget image" contenteditable="false"><img alt="baz quix" src=""></img></figure>'
);
} );

Expand All @@ -191,7 +191,7 @@ describe( 'Image converters', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
'<figure class="ck-widget image" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
);
} );
} );
Expand Down
20 changes: 10 additions & 10 deletions tests/image/imageengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ describe( 'ImageEngine', () => {
setModelData( document, '<image src="foo.png" alt="alt text"></image>' );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
'<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
);
} );

Expand All @@ -423,7 +423,7 @@ describe( 'ImageEngine', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img alt="new text" src="foo.png"></img></figure>'
'<figure class="ck-widget image" contenteditable="false"><img alt="new text" src="foo.png"></img></figure>'
);
} );

Expand All @@ -438,7 +438,7 @@ describe( 'ImageEngine', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) )
.to.equal( '<figure class="image ck-widget" contenteditable="false"><img src="foo.png"></img></figure>' );
.to.equal( '<figure class="ck-widget image" contenteditable="false"><img src="foo.png"></img></figure>' );
} );

it( 'should not convert change if is already consumed', () => {
Expand All @@ -456,7 +456,7 @@ describe( 'ImageEngine', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
'<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
);
} );

Expand All @@ -469,7 +469,7 @@ describe( 'ImageEngine', () => {
'</image>' );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w"></img>' +
'</figure>'
);
Expand All @@ -491,7 +491,7 @@ describe( 'ImageEngine', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -506,7 +506,7 @@ describe( 'ImageEngine', () => {
'</image>' );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w" width="1024"></img>' +
'</figure>'
);
Expand All @@ -523,7 +523,7 @@ describe( 'ImageEngine', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -545,7 +545,7 @@ describe( 'ImageEngine', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -569,7 +569,7 @@ describe( 'ImageEngine', () => {
);

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>'
);
Expand Down
52 changes: 26 additions & 26 deletions tests/imagecaption/imagecaptionengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe( 'ImageCaptionEngine', () => {
setModelData( doc, '<image src="img.png"><caption>Foo bar baz.</caption></image>' );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src="img.png"></img>' +
'<figcaption class="ck-editable" contenteditable="true" data-placeholder="Enter image caption">' +
'Foo bar baz.' +
Expand All @@ -130,9 +130,9 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<p>foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src="img.png"></img>' +
'<figcaption class="ck-placeholder ck-editable ck-hidden" ' +
'<figcaption class="ck-editable ck-hidden ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption">' +
'</figcaption>' +
'</figure>'
Expand Down Expand Up @@ -163,7 +163,7 @@ describe( 'ImageCaptionEngine', () => {
setModelData( doc, '<image src="img.png"><caption>Foo bar baz.</caption></image>' );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false"><img src="img.png"></img><span></span>Foo bar baz.</figure>'
'<figure class="ck-widget image" contenteditable="false"><img src="img.png"></img><span></span>Foo bar baz.</figure>'
);
} );

Expand All @@ -180,7 +180,7 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument ) ).to.equal(
'<p>{}foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src="img.png"></img>' +
'<figcaption class="ck-editable" contenteditable="true" data-placeholder="Enter image caption">' +
'foo bar' +
Expand All @@ -202,7 +202,7 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument ) ).to.equal(
'<p>{}foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src="img.png"></img>' +
'<figcaption class="ck-editable ck-hidden ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption">' +
Expand All @@ -224,7 +224,7 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument ) ).to.equal(
'<p>{}foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src="img.png"></img>' +
'<figcaption class="ck-editable" contenteditable="true" data-placeholder="Enter image caption">baz</figcaption>' +
'</figure>'
Expand All @@ -247,9 +247,9 @@ describe( 'ImageCaptionEngine', () => {
);

expect( getViewData( viewDocument ) ).to.equal(
'[<figure class="image ck-widget" contenteditable="false">' +
'[<figure class="ck-widget image" contenteditable="false">' +
'<img alt="" src=""></img>' +
'<figcaption class="ck-placeholder ck-editable" ' +
'<figcaption class="ck-editable ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption">' +
'</figcaption>' +
'</figure>]' +
Expand All @@ -271,7 +271,7 @@ describe( 'ImageCaptionEngine', () => {
);

expect( getViewData( viewDocument ) ).to.equal(
'[<figure class="image ck-widget" contenteditable="false">' +
'[<figure class="ck-widget image" contenteditable="false">' +
'<img alt="" src=""></img>' +
'<figcaption class="ck-editable" contenteditable="true" data-placeholder="Enter image caption">' +
'foo bar' +
Expand Down Expand Up @@ -300,9 +300,9 @@ describe( 'ImageCaptionEngine', () => {
);

expect( getViewData( viewDocument ) ).to.equal(
'[<figure class="image ck-widget" contenteditable="false">' +
'[<figure class="ck-widget image" contenteditable="false">' +
'<img alt="" src=""></img>' +
'<figcaption class="ck-placeholder ck-editable" ' +
'<figcaption class="ck-editable ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption"></figcaption>' +
'</figure>]' +
'<p></p>'
Expand Down Expand Up @@ -331,9 +331,9 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument ) ).to.equal(
'<p>foo</p>' +
'[<figure class="image ck-widget" contenteditable="false">' +
'[<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-placeholder ck-editable" contenteditable="true" data-placeholder="Enter image caption">' +
'<figcaption class="ck-editable ck-placeholder" contenteditable="true" data-placeholder="Enter image caption">' +
'</figcaption>' +
'</figure>]'
);
Expand All @@ -344,9 +344,9 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument ) ).to.equal(
'<p>{}foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-placeholder ck-editable ck-hidden" ' +
'<figcaption class="ck-editable ck-hidden ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption">' +
'</figcaption>' +
'</figure>'
Expand All @@ -358,7 +358,7 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument ) ).to.equal(
'<p>foo</p>' +
'[<figure class="image ck-widget" contenteditable="false">' +
'[<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-editable" contenteditable="true" data-placeholder="Enter image caption">foo bar</figcaption>' +
'</figure>]'
Expand All @@ -374,9 +374,9 @@ describe( 'ImageCaptionEngine', () => {

expect( getViewData( viewDocument ) ).to.equal(
'<p>{}foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-placeholder ck-editable ck-hidden" ' +
'<figcaption class="ck-editable ck-hidden ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption">' +
'</figcaption>' +
'</figure>'
Expand All @@ -391,7 +391,7 @@ describe( 'ImageCaptionEngine', () => {
} );

expect( getViewData( viewDocument ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-editable ck-placeholder" contenteditable="true" data-placeholder="Enter image caption">' +
'[]' +
Expand All @@ -410,7 +410,7 @@ describe( 'ImageCaptionEngine', () => {
} );

expect( getViewData( viewDocument ) ).to.equal(
'[<figure class="image ck-widget" contenteditable="false">' +
'[<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-editable ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption"></figcaption>' +
Expand All @@ -427,13 +427,13 @@ describe( 'ImageCaptionEngine', () => {
} );

expect( getViewData( viewDocument ) ).to.equal(
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-editable" contenteditable="true" data-placeholder="Enter image caption">foo bar</figcaption>' +
'</figure>' +
'[<figure class="image ck-widget" contenteditable="false">' +
'[<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-placeholder ck-editable" ' +
'<figcaption class="ck-editable ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption"></figcaption>' +
'</figure>]'
);
Expand All @@ -458,7 +458,7 @@ describe( 'ImageCaptionEngine', () => {
// Check if there is no figcaption in the view.
expect( getViewData( viewDocument ) ).to.equal(
'<p>{}foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-editable ck-hidden ck-placeholder" ' +
'contenteditable="true" data-placeholder="Enter image caption">' +
Expand All @@ -471,7 +471,7 @@ describe( 'ImageCaptionEngine', () => {
// Check if figcaption is back with contents.
expect( getViewData( viewDocument ) ).to.equal(
'<p>foo</p>' +
'<figure class="image ck-widget" contenteditable="false">' +
'<figure class="ck-widget image" contenteditable="false">' +
'<img src=""></img>' +
'<figcaption class="ck-editable" contenteditable="true" data-placeholder="Enter image caption">' +
'{foo bar baz}' +
Expand Down
Loading

0 comments on commit 9fc8f3d

Please sign in to comment.