浏览代码

Tests: Slight refactor in tests.

Szymon Cofalik 7 年之前
父节点
当前提交
6c69af8670
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3 7
      packages/ckeditor5-engine/tests/conversion/downcast-converters.js

+ 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', () => {
 		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' ) );
 			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( viewToString( viewRoot ) ).to.equal( '<div><p class="foo">foobar</p></div>' );
 
 
-			expect( spy.called ).to.be.true;
+			sinon.assert.called( callback );
 		} );
 		} );
 	} );
 	} );