|
|
@@ -10,7 +10,7 @@ import HtmlDataProcessor from 'ckeditor5-engine/src/dataprocessor/htmldataproces
|
|
|
import { getData, setData } from 'ckeditor5-engine/src/dev-utils/model';
|
|
|
|
|
|
import EditingController from 'ckeditor5-engine/src/controller/editingcontroller';
|
|
|
-import KeystrokeHandler from 'ckeditor5-core/src/keystrokehandler';
|
|
|
+import EditingKeystrokeHandler from 'ckeditor5-core/src/editingkeystrokehandler';
|
|
|
import Plugin from 'ckeditor5-core/src/plugin';
|
|
|
|
|
|
describe( 'StandardEditor', () => {
|
|
|
@@ -27,7 +27,14 @@ describe( 'StandardEditor', () => {
|
|
|
|
|
|
expect( editor ).to.have.property( 'element', editorElement );
|
|
|
expect( editor.editing ).to.be.instanceof( EditingController );
|
|
|
- expect( editor.keystrokes ).to.be.instanceof( KeystrokeHandler );
|
|
|
+ expect( editor.keystrokes ).to.be.instanceof( EditingKeystrokeHandler );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'activates #keystrokes', () => {
|
|
|
+ const spy = sinon.spy( EditingKeystrokeHandler.prototype, 'listenTo' );
|
|
|
+ const editor = new StandardEditor( editorElement, { foo: 1 } );
|
|
|
+
|
|
|
+ sinon.assert.calledWith( spy, editor.editing.view );
|
|
|
} );
|
|
|
|
|
|
it( 'sets config', () => {
|
|
|
@@ -37,6 +44,20 @@ describe( 'StandardEditor', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
+ describe( 'destroy()', () => {
|
|
|
+ it( 'destroys the #keystrokes', () => {
|
|
|
+ const editor = new StandardEditor( editorElement, { foo: 1 } );
|
|
|
+ const spy = sinon.spy( editor.keystrokes, 'destroy' );
|
|
|
+
|
|
|
+ sinon.assert.notCalled( spy );
|
|
|
+
|
|
|
+ return editor.destroy()
|
|
|
+ .then( () => {
|
|
|
+ sinon.assert.calledOnce( spy );
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+
|
|
|
describe( 'create', () => {
|
|
|
it( 'initializes editor with plugins and config', () => {
|
|
|
class PluginFoo extends Plugin {}
|