Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing test tests/core/creators/themedui #4096

Merged
merged 3 commits into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions tests/core/creators/themedui.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
} );

editor.resize( 100, 400 );
assert.areSame( 400, lastResizeData.outerHeight, 'Outer height should be same as passed one in 2nd argument.' );
assert.areSame( 100, lastResizeData.outerWidth, 'Outer width should be same as passed one in 1st argument.' );
assert.areSame( 400, lastResizeData.outerHeight, 'Resize event outer height should be same as passed one in 2nd argument.' );
assert.areSame( 100, lastResizeData.outerWidth, 'Resize event outer width should be same as passed one in 1st argument.' );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight, 'Content height should be same as calculated one.' );
assert.areSame( 400, getEditorOuterHeight( editor ), 'Outer height should be properly set.' );

editor.resize( 100, 400, true );
assert.areSame( getEditorOuterHeight( editor ), lastResizeData.outerHeight, 'Outer height should be same as calculated one.' );
assert.areSame( 100, lastResizeData.outerWidth, 'Outer width should be same as passed one in 1st argument.' );
assert.areSame( 400, lastResizeData.contentsHeight, 'Content height should be same as passed one in 2nd argument.' );
assert.areSame( getEditorOuterHeight( editor ), lastResizeData.outerHeight, 'Resize event outer height should be same as calculated one.' );
assert.areSame( 100, lastResizeData.outerWidth, 'Resize event outer width should be same as passed one in 1st argument.' );
assert.areSame( 400, lastResizeData.contentsHeight, 'Resize event content height should be same as passed one in 2nd argument.' );
assert.areSame( 400, getEditorContentHeight( editor ), 'Content height should be properly set.' );
},

Expand All @@ -70,13 +70,14 @@

for ( var i = 0; i < unitsToTest.length; i++ ) {
var width = 20 + unitsToTest[i],
height = 50 + unitsToTest[i];
height = 100 + unitsToTest[i];

editor.resize( width, height );
assert.areSame( CKEDITOR.tools.convertToPx( height ), lastResizeData.outerHeight );
assert.areSame( CKEDITOR.tools.convertToPx( width ), lastResizeData.outerWidth );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight );
assert.areSame( CKEDITOR.tools.convertToPx( height ), getEditorOuterHeight( editor ) );

assert.areSame( CKEDITOR.tools.convertToPx( height ), lastResizeData.outerHeight, 'Resize event outer height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( CKEDITOR.tools.convertToPx( height ), getEditorOuterHeight( editor ), 'Outer calculated height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight, 'Resize event content height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( CKEDITOR.tools.convertToPx( width ), lastResizeData.outerWidth, 'Resize event outer width in ' + unitsToTest[ i ] + ' is incorrect.' );
}
},

Expand All @@ -91,13 +92,13 @@

for ( var i = 0; i < unitsToTest.length; i++ ) {
var width = 20 + unitsToTest[i],
height = 50 + unitsToTest[i];
height = 100 + unitsToTest[i];

editor.resize( width, height, true );
assert.areSame( getEditorOuterHeight( editor ), lastResizeData.outerHeight );
assert.areSame( CKEDITOR.tools.convertToPx( width ), lastResizeData.outerWidth );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight );
assert.areSame( CKEDITOR.tools.convertToPx( height ), getEditorContentHeight( editor ) );
assert.areSame( getEditorOuterHeight( editor ), lastResizeData.outerHeight, 'Resize event outer height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( CKEDITOR.tools.convertToPx( width ), lastResizeData.outerWidth, 'Resize event outer width in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight, 'Resize event content height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( CKEDITOR.tools.convertToPx( height ), getEditorContentHeight( editor ), 'Content height in ' + unitsToTest[ i ] + ' is incorrect.' );
}
},

Expand All @@ -112,13 +113,14 @@

for ( var i = 0; i < unitsToTest.length; i++ ) {
var width = 20 + unitsToTest[i],
height = 50 + unitsToTest[i];
height = 100 + unitsToTest[i];

editor.resize( width, height, false, true );
assert.areSame( getEditorInnerHeight( editor ), lastResizeData.outerHeight );
assert.areSame( CKEDITOR.tools.convertToPx( width ), lastResizeData.outerWidth );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight );
assert.areSame( CKEDITOR.tools.convertToPx( height ), getEditorInnerHeight( editor ) );

assert.areSame( getEditorInnerHeight( editor ), lastResizeData.outerHeight, 'Resize event outer height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight, 'Resize event content height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( CKEDITOR.tools.convertToPx( height ), getEditorInnerHeight( editor ), 'Inner calculated height in ' + unitsToTest[ i ] + ' is incorrect.' );
assert.areSame( CKEDITOR.tools.convertToPx( width ), lastResizeData.outerWidth, 'Resize event width in ' + unitsToTest[ i ] + ' is incorrect.' );
}
}
} );
Expand Down