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

Commit

Permalink
Merge branch 't/ckeditor5-engine/858'
Browse files Browse the repository at this point in the history
Add omitted changes.
  • Loading branch information
Piotr Jasiun committed Nov 28, 2017
2 parents 56613a3 + e6ed1bc commit ef2712c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/image/converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function viewFigureToModel() {
data.context.pop();

// Add converted children to model image.
data.batch.insert( modelChildren, modelImage );
conversionApi.batch.insert( modelChildren, modelImage );

// Set model image as conversion result.
data.output = modelImage;
Expand Down
2 changes: 1 addition & 1 deletion src/imagecaption/imagecaptionengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function insertMissingModelCaptionElement( evt, changeType, data, batch ) {
// Make sure that the image does not have caption already.
// https://github.com/ckeditor/ckeditor5-image/issues/78
if ( !getCaptionFromImage( item ) ) {
batch.appendElement( 'caption', null, item );
batch.appendElement( 'caption', item );
}
} );
}
Expand Down
16 changes: 8 additions & 8 deletions tests/image/converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ describe( 'Image converters', () => {

describe( 'convertHoistableImage', () => {
it( 'should convert img element using already added converters if it is allowed in any point of given context #1', () => {
const result = dispatcher.convert( viewImg, { context: [ '$root', 'div', 'paragraph' ], batch } );
const result = dispatcher.convert( viewImg, batch, { context: [ '$root', 'div', 'paragraph' ] } );

// `result` is a model document fragment.
expect( result.childCount ).to.equal( 1 );
Expand All @@ -241,7 +241,7 @@ describe( 'Image converters', () => {
} );

it( 'should convert img element using already added converters if it is allowed in any point of given context #2', () => {
const result = dispatcher.convert( viewImg, { context: [ '$root', modelDiv, modelParagraph ], batch } );
const result = dispatcher.convert( viewImg, batch, { context: [ '$root', modelDiv, modelParagraph ] } );

// `result` is a model document fragment.
expect( result.childCount ).to.equal( 1 );
Expand All @@ -251,15 +251,15 @@ describe( 'Image converters', () => {
} );

it( 'should not convert img element if there is no allowed context #1', () => {
const result = dispatcher.convert( viewImg, { context: [ 'div', 'paragraph' ], batch } );
const result = dispatcher.convert( viewImg, batch, { context: [ 'div', 'paragraph' ] } );

// `result` is an empty model document fragment.
expect( result.childCount ).to.equal( 0 );
expect( imgConverterCalled ).to.be.false;
} );

it( 'should not convert img element if there is no allowed context #2', () => {
const result = dispatcher.convert( viewImg, { context: [ modelDiv, modelParagraph ], batch } );
const result = dispatcher.convert( viewImg, batch, { context: [ modelDiv, modelParagraph ] } );

// `result` is an empty model document fragment.
expect( result.childCount ).to.equal( 0 );
Expand All @@ -269,7 +269,7 @@ describe( 'Image converters', () => {
it( 'should not convert img element if allowed context is "above" limiting element #1', () => {
schema.limits.add( 'limit' );

const result = dispatcher.convert( viewImg, { context: [ '$root', 'limit', 'div', 'paragraph' ], batch } );
const result = dispatcher.convert( viewImg, batch, { context: [ '$root', 'limit', 'div', 'paragraph' ] } );

// `result` is an empty model document fragment.
expect( result.childCount ).to.equal( 0 );
Expand All @@ -279,7 +279,7 @@ describe( 'Image converters', () => {
it( 'should not convert img element if allowed context is "above" limiting element #2', () => {
schema.limits.add( 'limit' );

const result = dispatcher.convert( viewImg, { context: [ '$root', modelLimit, modelDiv, modelParagraph ], batch } );
const result = dispatcher.convert( viewImg, batch, { context: [ '$root', modelLimit, modelDiv, modelParagraph ] } );

// `result` is an empty model document fragment.
expect( result.childCount ).to.equal( 0 );
Expand All @@ -301,7 +301,7 @@ describe( 'Image converters', () => {
// because image is not allowed in div.
const viewDiv = new ViewContainerElement( 'div', null, [ 'foo', viewImg, 'bar' ] );

const result = dispatcher.convert( viewDiv, { context: [ '$root' ], batch } );
const result = dispatcher.convert( viewDiv, batch, { context: [ '$root' ] } );

// `result` is a model document fragment.
expect( result.childCount ).to.equal( 3 );
Expand All @@ -320,7 +320,7 @@ describe( 'Image converters', () => {

const viewDiv = new ViewContainerElement( 'p', null, [ 'foo', viewImg, 'bar' ] );

const result = dispatcher.convert( viewDiv, { context: [ '$root', 'div' ], batch } );
const result = dispatcher.convert( viewDiv, batch, { context: [ '$root', 'div' ] } );

// `result` is a model document fragment.
expect( result.childCount ).to.equal( 3 );
Expand Down

0 comments on commit ef2712c

Please sign in to comment.