8
0
Просмотр исходного кода

Tests: Moved assertions closer to tested code.

Marek Lewandowski 6 лет назад
Родитель
Сommit
122c94a009
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      packages/ckeditor5-widget/tests/widgetresize.js

+ 4 - 4
packages/ckeditor5-widget/tests/widgetresize.js

@@ -139,13 +139,13 @@ describe( 'WidgetResize', () => {
 
 			const intermediatePointerPosition = initialPointerPosition.clone().moveBy( 50, 0 );
 			mouseMock.dragTo( editor, domParts.resizeHandle, intermediatePointerPosition );
+			sinon.assert.calledWithExactly( commitStub.firstCall, '150px' );
 
 			const finalPointerPosition = intermediatePointerPosition.clone().moveBy( 50, 0 );
 			mouseMock.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
+			sinon.assert.calledWithExactly( commitStub.secondCall, '200px' );
 
 			expect( commitStub.callCount ).to.be.equal( 2 );
-			sinon.assert.calledWithExactly( commitStub.firstCall, '150px' );
-			sinon.assert.calledWithExactly( commitStub.secondCall, '200px' );
 		} );
 
 		it( 'hides the resize wrapper when resizer gets disabled', () => {
@@ -170,13 +170,13 @@ describe( 'WidgetResize', () => {
 
 			const intermediatePointerPosition = initialPointerPosition.clone().moveBy( 100, 0 );
 			mouseMock.dragTo( editor, domParts.resizeHandle, intermediatePointerPosition );
+			sinon.assert.calledWithExactly( commitStub.firstCall, '50%' );
 
 			const finalPointerPosition = intermediatePointerPosition.clone().moveBy( 100, 0 );
 			mouseMock.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
+			sinon.assert.calledWithExactly( commitStub.secondCall, '75%' );
 
 			expect( commitStub.callCount ).to.be.equal( 2 );
-			sinon.assert.calledWithExactly( commitStub.firstCall, '50%' );
-			sinon.assert.calledWithExactly( commitStub.secondCall, '75%' );
 		} );
 	} );