diff --git a/tests/plugins/emoji/basic.js b/tests/plugins/emoji/basic.js index 54f0396630b..9b4447f129a 100644 --- a/tests/plugins/emoji/basic.js +++ b/tests/plugins/emoji/basic.js @@ -148,13 +148,21 @@ // (#2195) 'test emoji suggestion box shouldn\'t appear inside text': function( editor, bot ) { emojiTools.runAfterInstanceReady( editor, bot, function( editor, bot ) { - var autocomplete = editor._.emoji.autocomplete; + var autocomplete = editor._.emoji.autocomplete, + editable = editor.editable(); bot.setHtmlWithSelection( '

foo:bug^

' ); - editor.editable().fire( 'keyup', new CKEDITOR.dom.event( {} ) ); - emojiTools.assertIsNullOrUndefined( autocomplete.model.query ); - emojiTools.assertIsNullOrUndefined( autocomplete.model.data ); + // Delay assertions because of autocomplete throttle. + setTimeout( function() { + resume( function() { + emojiTools.assertIsNullOrUndefined( autocomplete.model.query ); + emojiTools.assertIsNullOrUndefined( autocomplete.model.data ); + } ); + }, 50 ); + + editable.fire( 'keyup', new CKEDITOR.dom.event( {} ) ); + wait(); } ); } };