Navigation Menu

Skip to content

Commit

Permalink
Fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Mar 14, 2017
1 parent 1c9a8bc commit 60b4261
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
5 changes: 5 additions & 0 deletions tests/core/selection/editor.js
Expand Up @@ -422,6 +422,8 @@ bender.test( {
editor.setData( '<p id="p">foo<em>bar</em></p>' );
editor.setMode( 'wysiwyg', function() {
resume( function() {
// Editor needs to have focus to remove FC on keydown. (#14714)
editor.focus();
// TC1 - on keydown
// <p>foo^<em>...
var range = editor.createRange();
Expand Down Expand Up @@ -541,6 +543,9 @@ bender.test( {

this.assertFillingChar( editable, uEl, 'abc', 'after typing' );

// Editor needs to have focus to remove FC on keydown. (#14714)
editor.focus();

// Mock LEFT arrow.
editor.document.fire( 'keydown', new CKEDITOR.dom.event( { keyCode: 37 } ) );

Expand Down
28 changes: 6 additions & 22 deletions tests/core/selection/selection.js
Expand Up @@ -697,29 +697,13 @@ bender.test( {
assert.isFalse( preventSpy.called, 'preventDefault() on keydown was called' );
},

'test remove filling char sequence on keydown': function() {
var editable = this.editor.editable();
var fillingCharSequence = CKEDITOR.tools.repeat( '\u200b', 7 );

var par = this.editor.document.$.createElement( 'p' );
var span = this.editor.document.$.createElement( 'span' );
var text = editable.getDocument().createText( fillingCharSequence );

par.appendChild( span );
span.appendChild( text.$ );

editable.setCustomData( 'cke-fillingChar', text );
editable.focus();
editable.$.innerHTML = '';
editable.$.appendChild( par );

assert.areEqual( 7, editable.$.innerText.length, 'before' );
this.editor.document.fire( 'keydown', new CKEDITOR.dom.event( { keyCode: 46 } ) );

assert.areEqual( 0, editable.$.innerText.length );
},

// (#14714)
'test remove filling char sequence on keydown blur': function() {
if ( !CKEDITOR.env.webkit ) {
assert.ignore();
}

// If editor has no focus, filling character should not be removed in WebKits. (#14714)
var editable = this.editor.editable();
var fillingCharSequence = CKEDITOR.tools.repeat( '\u200b', 7 );

Expand Down

0 comments on commit 60b4261

Please sign in to comment.