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

Add proper editor destructuring for tests. #15

Merged
merged 1 commit into from
Dec 19, 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
12 changes: 10 additions & 2 deletions tests/uploadadapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -39,6 +39,14 @@ describe( 'CKFinderUploadAdapter', () => {

afterEach( () => {
sinonXHR.restore();

if ( editorElement ) {
editorElement.remove();
}

if ( editor ) {
return editor.destroy();
}
} );

it( 'should be loaded', () => {
Expand Down