Skip to content
Permalink
Browse files

Fixed tests.

  • Loading branch information
mlewand committed Mar 14, 2017
1 parent 1c9a8bc commit 60b4261ae08dd887deab5fa77b4555f42ede7150
Showing with 11 additions and 22 deletions.
  1. +5 −0 tests/core/selection/editor.js
  2. +6 −22 tests/core/selection/selection.js
@@ -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();
@@ -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 } ) );

@@ -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 );

0 comments on commit 60b4261

Please sign in to comment.
You can’t perform that action at this time.