function _pasteText($element, text, { availableFormats }) {
const pasteEvent = new window.Event('paste');
pasteEvent.clipboardData = {
getData: type => (type in availableFormats) ? text || '' : ''
};
placeCursorAtStartOfNode($element[0]);
$element[0].dispatchEvent(pasteEvent);
$element.closest('.AsMediumEditor').trigger(Ember.$.Event('input'));
}
_pasteText(this.$('.AsMediumEditor'), HTML_WITH_ONCLICK_HANDLER, { availableFormats: ['text/html', 'text/plain'] });
_pasteText(this.$('.AsMediumEditor'), 'Foo\nBar\nBaz', { availableFormats: ['text/plain'] });