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

Tests: Added test ensuring toolbar visibility after clicking the resizer with no dragging.

See https://github.com/ckeditor/ckeditor5-widget/pull/112#pullrequestreview-337725256.
Marek Lewandowski 6 лет назад
Родитель
Сommit
b7a310f839
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      packages/ckeditor5-image/tests/imageresize.js

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

@@ -776,6 +776,19 @@ describe( 'ImageResize', () => {
 				}
 			} )();
 		} );
+
+		it( 'restores toolbar when clicking the handle without drag', () => {
+			// (https://github.com/ckeditor/ckeditor5-widget/pull/112#pullrequestreview-337725256).
+			const resizerPosition = 'bottom-left';
+			const domParts = getWidgetDomParts( widget, resizerPosition );
+			const initialPointerPosition = getResizerCoordinates( domParts.figure, resizerPosition );
+
+			focusEditor( editor );
+			fireMouseEvent( domParts.resizeHandle, 'mousedown', initialPointerPosition );
+			fireMouseEvent( domParts.resizeHandle, 'mouseup', initialPointerPosition );
+
+			expect( widgetToolbarRepository.isEnabled ).to.be.true;
+		} );
 	} );
 
 	function isVisible( element ) {