Преглед на файлове

Tests: Added test case for #5189.

Marek Lewandowski преди 6 години
родител
ревизия
303b28ae74
променени са 1 файла, в които са добавени 19 реда и са изтрити 0 реда
  1. 19 0
      packages/ckeditor5-image/tests/imageresize.js

+ 19 - 0
packages/ckeditor5-image/tests/imageresize.js

@@ -412,6 +412,25 @@ describe( 'ImageResize', () => {
 			resizerPosition: 'top-right'
 		} ) );
 
+		it( 'doesn\'t flicker at the beginning of the resize', async () => {
+			// (#5189)
+			const resizerPosition = 'bottom-left';
+			const domParts = getWidgetDomParts( widget, resizerPosition );
+			const initialPointerPosition = getResizerCoordinates( domParts.figure, resizerPosition );
+			const resizeWrapperView = widget.getChild( 1 );
+
+			focusEditor( editor );
+			fireMouseEvent( domParts.resizeHandle, 'mousedown', initialPointerPosition );
+
+			await wait( 40 );
+
+			fireMouseEvent( domParts.resizeHandle, 'mousemove', initialPointerPosition );
+
+			expect( resizeWrapperView.getStyle( 'width' ) ).to.be.equal( '100px' );
+
+			fireMouseEvent( domParts.resizeHandle, 'mouseup', initialPointerPosition );
+		} );
+
 		it( 'makes no change when clicking the handle without drag', () => {
 			const resizerPosition = 'bottom-left';
 			const expectedWidth = 100;