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

Commit

Permalink
Tests: Slight refactor in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik committed Mar 21, 2018
1 parent ffdd4df commit 849cef9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/conversion/downcast-converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,9 @@ describe( 'downcast-converters', () => {
} );

it( 'should not convert or consume if element creator returned null', () => {
const spy = sinon.spy();

dispatcher.on( 'attribute:class', changeAttribute( () => {
spy();
const callback = sinon.stub().returns( null );

return null;
} ) );
dispatcher.on( 'attribute:class', changeAttribute( callback ) );

const modelElement = new ModelElement( 'paragraph', { class: 'foo' }, new ModelText( 'foobar' ) );

Expand All @@ -704,7 +700,7 @@ describe( 'downcast-converters', () => {

expect( viewToString( viewRoot ) ).to.equal( '<div><p class="foo">foobar</p></div>' );

expect( spy.called ).to.be.true;
sinon.assert.called( callback );
} );
} );

Expand Down

0 comments on commit 849cef9

Please sign in to comment.