diff --git a/src/model/model.js b/src/model/model.js index d07e336b8..61a6b73f0 100644 --- a/src/model/model.js +++ b/src/model/model.js @@ -702,10 +702,11 @@ export default class Model { * * {@link #change `change()`}, * * {@link #enqueueChange `enqueueChange()`}. * + * @param {'transparent'|'default'} [type='default'] The type of the batch. * @returns {module:engine/model/batch~Batch} */ - createBatch() { - return new Batch(); + createBatch( type ) { + return new Batch( type ); } /** diff --git a/tests/model/model.js b/tests/model/model.js index 7e4178e0e..2762e8163 100644 --- a/tests/model/model.js +++ b/tests/model/model.js @@ -774,7 +774,15 @@ describe( 'Model', () => { describe( 'createBatch()', () => { it( 'should return instance of Batch', () => { - expect( model.createBatch() ).to.be.instanceof( Batch ); + const batch = model.createBatch(); + expect( batch ).to.be.instanceof( Batch ); + expect( batch.type ).to.equal( 'default' ); + } ); + + it( 'should allow to define type of Batch', () => { + const batch = model.createBatch( 'transparent' ); + expect( batch ).to.be.instanceof( Batch ); + expect( batch.type ).to.equal( 'transparent' ); } ); } );