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

Commit

Permalink
Merge 578a649 into e0de158
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed May 17, 2019
2 parents e0de158 + 578a649 commit 72dd5ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down
10 changes: 9 additions & 1 deletion tests/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
} );
} );

Expand Down

0 comments on commit 72dd5ed

Please sign in to comment.