|
|
@@ -6,33 +6,35 @@
|
|
|
import Plugin from '../src/plugin';
|
|
|
import Editor from '../src/editor/editor';
|
|
|
|
|
|
-let editor;
|
|
|
+describe( 'Plugin', () => {
|
|
|
+ let editor;
|
|
|
|
|
|
-before( () => {
|
|
|
- editor = new Editor();
|
|
|
-} );
|
|
|
-
|
|
|
-describe( 'constructor()', () => {
|
|
|
- it( 'should set the `editor` property', () => {
|
|
|
- const plugin = new Plugin( editor );
|
|
|
-
|
|
|
- expect( plugin ).to.have.property( 'editor' ).to.equal( editor );
|
|
|
+ beforeEach( () => {
|
|
|
+ editor = new Editor();
|
|
|
} );
|
|
|
|
|
|
- describe( 'destroy()', () => {
|
|
|
- it( 'should be defined', () => {
|
|
|
+ describe( 'constructor()', () => {
|
|
|
+ it( 'should set the `editor` property', () => {
|
|
|
const plugin = new Plugin( editor );
|
|
|
|
|
|
- expect( plugin.destroy ).to.be.a( 'function' );
|
|
|
+ expect( plugin ).to.have.property( 'editor' ).to.equal( editor );
|
|
|
} );
|
|
|
|
|
|
- it( 'should stop listening', () => {
|
|
|
- const plugin = new Plugin( editor );
|
|
|
- const stopListeningSpy = sinon.spy( plugin, 'stopListening' );
|
|
|
+ describe( 'destroy()', () => {
|
|
|
+ it( 'should be defined', () => {
|
|
|
+ const plugin = new Plugin( editor );
|
|
|
+
|
|
|
+ expect( plugin.destroy ).to.be.a( 'function' );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'should stop listening', () => {
|
|
|
+ const plugin = new Plugin( editor );
|
|
|
+ const stopListeningSpy = sinon.spy( plugin, 'stopListening' );
|
|
|
|
|
|
- plugin.destroy();
|
|
|
+ plugin.destroy();
|
|
|
|
|
|
- expect( stopListeningSpy.calledOnce ).to.equal( true );
|
|
|
+ expect( stopListeningSpy.calledOnce ).to.equal( true );
|
|
|
+ } );
|
|
|
} );
|
|
|
} );
|
|
|
} );
|