Skip to content

Commit

Permalink
Tests: fixed failing on IE.
Browse files Browse the repository at this point in the history
  • Loading branch information
engineering-this committed Oct 3, 2018
1 parent 9259790 commit d167527
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions tests/plugins/dialog/positioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,24 @@
},
// When drag starts, dialog becomes centered with `position:absolute`, then it moves together with mouse (#2395).
'test dialog move': function() {
var window = CKEDITOR.document.getWindow(),
viewPaneSize = {
width: 1000,
height: 1000
},
stubs = {
getWindow: sinon.stub( CKEDITOR.document, 'getWindow' ),
getViewPane: sinon.stub( window, 'getViewPaneSize' )
};

stubs.getWindow.returns( window );
stubs.getViewPane.returns( viewPaneSize );

this.editorBot.dialog( 'link', function( dialog ) {
var window = CKEDITOR.document.getWindow(),
viewPaneSize = {
width: 1000,
height: 1000
},
element = dialog._.element.getFirst(),
var element = dialog._.element.getFirst(),
dialogSize = dialog.getSize(),
expectedX = Math.floor( ( viewPaneSize.width - dialogSize.width ) / 2 / viewPaneSize.width * 100 ),
expectedY = Math.floor( ( viewPaneSize.height - dialogSize.height ) / 2 / viewPaneSize.width * 100 ),
stubs = {
getWindow: sinon.stub( CKEDITOR.document, 'getWindow' ),
getViewPane: sinon.stub( window, 'getViewPaneSize' )
};

stubs.getWindow.returns( window );
stubs.getViewPane.returns( viewPaneSize );
expectedY = Math.floor( ( viewPaneSize.height - dialogSize.height ) / 2 / viewPaneSize.width * 100 );

dialog.parts.title.fire( 'mousedown', {
$: {
Expand Down

0 comments on commit d167527

Please sign in to comment.