Sfoglia il codice sorgente

Tests: More resizer tests.

Marek Lewandowski 6 anni fa
parent
commit
f045c94eff
1 ha cambiato i file con 40 aggiunte e 0 eliminazioni
  1. 40 0
      packages/ckeditor5-image/tests/imageresize/resize.js

+ 40 - 0
packages/ckeditor5-image/tests/imageresize/resize.js

@@ -226,6 +226,26 @@ describe.only( 'Image resizer', () => {
 			resizerPosition: 'bottom-right'
 		} ) );
 
+		it( 'shrinks correctly with left-top handler', generateResizeTest( {
+			isSideImage: true,
+			expectedWidth: 80,
+			pointerOffset: {
+				x: 20,
+				y: 10
+			},
+			resizerPosition: 'top-left'
+		} ) );
+
+		it( 'shrinks correctly with right-top handler', generateResizeTest( {
+			isSideImage: true,
+			expectedWidth: 80,
+			pointerOffset: {
+				x: -20,
+				y: 10
+			},
+			resizerPosition: 'top-right'
+		} ) );
+
 		it( 'enlarges correctly with left-bottom handler', generateResizeTest( {
 			isSideImage: true,
 			expectedWidth: 120,
@@ -265,6 +285,26 @@ describe.only( 'Image resizer', () => {
 			},
 			resizerPosition: 'bottom-right'
 		} ) );
+
+		it( 'enlarges correctly with left-top handler', generateResizeTest( {
+			isSideImage: true,
+			expectedWidth: 120,
+			pointerOffset: {
+				x: -20,
+				y: -10
+			},
+			resizerPosition: 'top-left'
+		} ) );
+
+		it( 'enlarges correctly with right-top handler', generateResizeTest( {
+			isSideImage: true,
+			expectedWidth: 120,
+			pointerOffset: {
+				x: 20,
+				y: 10
+			},
+			resizerPosition: 'top-right'
+		} ) );
 	} );
 
 	function isVisible( element ) {