Skip to content

Instantly share code, notes, and snippets.

@mlewand
Created July 26, 2018 11:56
Show Gist options
  • Save mlewand/ee09f6dc0148792c8d08f53cc55da605 to your computer and use it in GitHub Desktop.
Save mlewand/ee09f6dc0148792c8d08f53cc55da605 to your computer and use it in GitHub Desktop.
A sample code to break CKE4 mode creation
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: divarea */
( function() {
'use strict';
bender.test( {
// (#2257)
'test destroy editor on instance created': function() {
var editor = CKEDITOR.replace( 'destroyed' ),
wysiwygModeSpy;
editor.on( 'destroy', function() {
resume( function() {
assert.isFalse( wysiwygModeSpy.threw(), 'WYSIWYG mode function should not throw an exception' );
} );
} );
editor.on( 'beforeSetMode', function() {
wysiwygModeSpy = sinon.spy( editor._.modes, 'wysiwyg' );
editor.destroy();
} );
wait();
}
} );
} )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment