Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Fixed tests leaking editor instance / DOM element. #221

Merged
merged 1 commit into from
Dec 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import env from '@ckeditor/ckeditor5-utils/src/env';
/* global document */

describe( 'Input feature', () => {
let editor, model, modelRoot, view, viewDocument, viewRoot, listenter;
let editor, model, modelRoot, view, viewDocument, viewRoot, listenter, domElement;

testUtils.createSinonSandbox();

beforeEach( () => {
listenter = Object.create( EmitterMixin );

const domElement = document.createElement( 'div' );
domElement = document.createElement( 'div' );
document.body.appendChild( domElement );

return ClassicTestEditor.create( domElement, { plugins: [ Input, Paragraph, Bold, Italic, List, ShiftEnter, Link ] } )
Expand Down Expand Up @@ -66,6 +66,7 @@ describe( 'Input feature', () => {

afterEach( () => {
listenter.stopListening();
domElement.remove();

return editor.destroy();
} );
Expand Down Expand Up @@ -1022,7 +1023,7 @@ describe( 'Input feature', () => {
} );

describe( 'Input feature - Android', () => {
let editor, model, modelRoot, view, viewDocument, listenter, oldEnvIsAndroid;
let editor, model, modelRoot, view, viewDocument, listenter, oldEnvIsAndroid, domElement;

testUtils.createSinonSandbox();

Expand All @@ -1034,7 +1035,7 @@ describe( 'Input feature - Android', () => {
beforeEach( () => {
listenter = Object.create( EmitterMixin );

const domElement = document.createElement( 'div' );
domElement = document.createElement( 'div' );
document.body.appendChild( domElement );

return ClassicTestEditor.create( domElement, { plugins: [ Input, Paragraph, Bold, Italic, List, ShiftEnter, Link ] } )
Expand All @@ -1055,6 +1056,7 @@ describe( 'Input feature - Android', () => {

afterEach( () => {
listenter.stopListening();
domElement.remove();

return editor.destroy();
} );
Expand Down