From 13ce18f38700c46c7bfa570c7ff3a443bf4c5b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Wed, 18 Dec 2019 15:22:31 +0100 Subject: [PATCH] Add proper editor destructuring for tests. --- tests/uploadadapter.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/uploadadapter.js b/tests/uploadadapter.js index 0fcffb0..8da47c5 100644 --- a/tests/uploadadapter.js +++ b/tests/uploadadapter.js @@ -15,11 +15,11 @@ import { createNativeFileMock } from '@ckeditor/ckeditor5-upload/tests/_utils/mo import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils'; describe( 'CKFinderUploadAdapter', () => { - let editor, sinonXHR, fileRepository; + let editor, sinonXHR, fileRepository, editorElement; testUtils.createSinonSandbox(); beforeEach( () => { - const editorElement = document.createElement( 'div' ); + editorElement = document.createElement( 'div' ); document.body.appendChild( editorElement ); sinonXHR = testUtils.sinon.useFakeServer(); @@ -39,6 +39,14 @@ describe( 'CKFinderUploadAdapter', () => { afterEach( () => { sinonXHR.restore(); + + if ( editorElement ) { + editorElement.remove(); + } + + if ( editor ) { + return editor.destroy(); + } } ); it( 'should be loaded', () => {