Skip to content

Commit

Permalink
Review fixes: ignroe test cases on old IE. Adapt assertion for Edge/IE.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed Nov 16, 2017
1 parent a1726c4 commit eda5ef3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
12 changes: 7 additions & 5 deletions tests/plugins/inlinetoolbar/cssdefault.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

// We need to set up skin at the very beginning before files start to load.
CKEDITOR.skinName = 'moono';

// Overwrite prototype to simulate missing css file.
var oldFn = CKEDITOR.dom.document.prototype.appendStyleSheet;
CKEDITOR.dom.document.prototype.appendStyleSheet = function( cssFileUrl ) {
Expand All @@ -43,10 +44,11 @@
}
};


var tests = {
'test check moono skin usage': function( editor ) {

'test check default.css file usage when skin miss adequate css': function( editor ) {
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) {
assert.ignore();
}
var panel = new CKEDITOR.ui.inlineToolbar( editor );
panel.addItems( {
bold: new CKEDITOR.ui.button( {
Expand All @@ -55,8 +57,8 @@
} )
} );
panel.attach( editor.editable().findOne( 'p' ) );
assert.areSame( 'rgb(248, 248, 248)', panel._view.parts.panel.getComputedStyle( 'background-color' ),
'Default skin background color seems to be incorrect.' );
assert.areSame( 'background-color:#f8f8f8;', CKEDITOR.tools.normalizeCssText( 'background-color:' + panel._view.parts.panel.getComputedStyle( 'background-color' ) + ';' ),
'Default skin background color is incorrect.' );
}
};

Expand Down
12 changes: 8 additions & 4 deletions tests/plugins/inlinetoolbar/cssskin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

( function() {
'use strict';
// Please be aware that entire test suite has to use the same skin. That's why tests are separate between 2 files.

bender.editors = {
classic: {
Expand Down Expand Up @@ -37,7 +36,10 @@
CKEDITOR.skinName = 'moono';

var tests = {
'test check default css usage': function( editor ) {
'test check moono skin usage': function( editor ) {
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) {
assert.ignore();
}

var panel = new CKEDITOR.ui.inlineToolbar( editor );
panel.addItems( {
Expand All @@ -47,8 +49,10 @@
} )
} );
panel.attach( editor.editable().findOne( 'p' ) );
assert.areSame( 'rgba(0, 0, 0, 0)', panel._view.parts.panel.getComputedStyle( 'background-color' ),
'Background color seems to be incorrect.' );
// IE use cke_reset styles, that' why there is transparent.
assert.areSame( CKEDITOR.env.ie ? 'background-color:transparent;' : 'background-color:#000000;',
CKEDITOR.tools.normalizeCssText( 'background-color:' + panel._view.parts.panel.getComputedStyle( 'background-color' ) + ';' ),
'Background color is incorrect.' );
}
};

Expand Down
3 changes: 3 additions & 0 deletions tests/plugins/inlinetoolbar/manual/fallbackstyles.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
</div>

<script>
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) {
bender.ignore();
}
function instanceReadyListener( evt ) {
var images = this.editable().find( 'img' ).toArray(),
panel = new CKEDITOR.ui.inlineToolbar( this );
Expand Down

0 comments on commit eda5ef3

Please sign in to comment.