|
@@ -123,8 +123,6 @@ describe( 'WidgetResize', () => {
|
|
|
|
|
|
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
|
mouseMock.up();
|
|
mouseMock.up();
|
|
|
|
|
|
|
@@ -158,8 +156,6 @@ describe( 'WidgetResize', () => {
|
|
|
|
|
|
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
mouseMock.move( editor, domParts.resizeHandle, initialPointerPosition );
|
|
mouseMock.move( editor, domParts.resizeHandle, initialPointerPosition );
|
|
|
mouseMock.up();
|
|
mouseMock.up();
|
|
|
} );
|
|
} );
|
|
@@ -181,13 +177,9 @@ describe( 'WidgetResize', () => {
|
|
|
|
|
|
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
|
mouseMock.up();
|
|
mouseMock.up();
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
// THe image should be enlarged by a twice of the mouse movement distance.
|
|
// THe image should be enlarged by a twice of the mouse movement distance.
|
|
|
sinon.assert.calledWithExactly( commitStub, '140px' );
|
|
sinon.assert.calledWithExactly( commitStub, '140px' );
|
|
|
} );
|
|
} );
|
|
@@ -207,17 +199,11 @@ describe( 'WidgetResize', () => {
|
|
|
|
|
|
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
|
mouseMock.up();
|
|
mouseMock.up();
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
finalPointerPosition.pageX += 50;
|
|
finalPointerPosition.pageX += 50;
|
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
|
mouseMock.up();
|
|
mouseMock.up();
|
|
@@ -245,17 +231,11 @@ describe( 'WidgetResize', () => {
|
|
|
|
|
|
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
|
mouseMock.up();
|
|
mouseMock.up();
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
mouseMock.down( editor, domParts.resizeHandle );
|
|
|
|
|
|
|
|
- await wait( 40 );
|
|
|
|
|
-
|
|
|
|
|
finalPointerPosition.pageX += 100;
|
|
finalPointerPosition.pageX += 100;
|
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
mouseMock.move( editor, domParts.resizeHandle, finalPointerPosition );
|
|
|
mouseMock.up();
|
|
mouseMock.up();
|
|
@@ -371,8 +351,4 @@ describe( 'WidgetResize', () => {
|
|
|
editor.editing.view.focus();
|
|
editor.editing.view.focus();
|
|
|
editor.ui.focusTracker.isFocused = true;
|
|
editor.ui.focusTracker.isFocused = true;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- function wait( delay ) {
|
|
|
|
|
- return new Promise( resolve => window.setTimeout( () => resolve(), delay ) );
|
|
|
|
|
- }
|
|
|
|
|
} );
|
|
} );
|