8
0
Pārlūkot izejas kodu

Tests: Slight refactor in tests.

Szymon Cofalik 7 gadi atpakaļ
vecāks
revīzija
6c69af8670

+ 3 - 7
packages/ckeditor5-engine/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( '<div><p class="foo">foobar</p></div>' );
 
-			expect( spy.called ).to.be.true;
+			sinon.assert.called( callback );
 		} );
 	} );