Skip to content

Commit

Permalink
emoji inside text test, assertions are now inside setTimeout because …
Browse files Browse the repository at this point in the history
…of throttle
  • Loading branch information
engineering-this authored and msamsel committed Aug 3, 2018
1 parent f1d92f1 commit b090729
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/plugins/emoji/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( '<p>foo:bug^</p>' );

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();
} );
}
};
Expand Down

0 comments on commit b090729

Please sign in to comment.