diff --git a/tests/conversion/downcast-converters.js b/tests/conversion/downcast-converters.js index 463615370..a874a7792 100644 --- a/tests/conversion/downcast-converters.js +++ b/tests/conversion/downcast-converters.js @@ -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' ) ); @@ -704,7 +700,7 @@ describe( 'downcast-converters', () => { expect( viewToString( viewRoot ) ).to.equal( '

foobar

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