Skip to content

Commit

Permalink
Merge pull request #661 from ckeditor/t/660
Browse files Browse the repository at this point in the history
Fix for unit test for IE8
  • Loading branch information
Comandeer authored Jul 21, 2017
2 parents f450a78 + 161fcf7 commit 36394a4
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions tests/plugins/notification/notoolbarlayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@

editor.once( 'notificationShow', function( evt ) {
// just wait after entire call stack will be free, so notification will be visible.
setTimeout( resume( function() {
var contentRect = editor.ui.contentsElement.getClientRect(),
notificationRect = evt.data.notification.element.getClientRect();
setTimeout( function() {
resume( function() {
var contentRect = editor.ui.contentsElement.getClientRect(),
notificationRect = evt.data.notification.element.getClientRect();

assert.areSame( 'foo', evt.data.notification.message );
assert.areSame( 'warn', evt.data.notification.type );
assert.areSame( 'foo', evt.data.notification.message );
assert.areSame( 'warn', evt.data.notification.type );

// editor size should be enought to kept message inside editable
bender.assert.isNumberInRange( parseInt( notificationRect.left, 10 ), parseInt( contentRect.left, 10 ), parseInt( contentRect.right, 10 ) );
bender.assert.isNumberInRange( parseInt( notificationRect.right, 10 ), parseInt( contentRect.left, 10 ), parseInt( contentRect.right, 10 ) );
bender.assert.isNumberInRange( parseInt( notificationRect.top, 10 ), parseInt( contentRect.top, 10 ), parseInt( contentRect.bottom, 10 ) );
bender.assert.isNumberInRange( parseInt( notificationRect.bottom, 10 ), parseInt( contentRect.top, 10 ), parseInt( contentRect.bottom, 10 ) );
// editor size should be enought to kept message inside editable
bender.assert.isNumberInRange( parseInt( notificationRect.left, 10 ), parseInt( contentRect.left, 10 ), parseInt( contentRect.right, 10 ) );
bender.assert.isNumberInRange( parseInt( notificationRect.right, 10 ), parseInt( contentRect.left, 10 ), parseInt( contentRect.right, 10 ) );
bender.assert.isNumberInRange( parseInt( notificationRect.top, 10 ), parseInt( contentRect.top, 10 ), parseInt( contentRect.bottom, 10 ) );
bender.assert.isNumberInRange( parseInt( notificationRect.bottom, 10 ), parseInt( contentRect.top, 10 ), parseInt( contentRect.bottom, 10 ) );

evt.data.notification.hide();
} ), 0 );
evt.data.notification.hide();
} );
}, 0 );
} );

editor.showNotification( 'foo', 'warn' );
Expand Down

0 comments on commit 36394a4

Please sign in to comment.