From 3b7b313fbb5fbb69ca8ff1821ff737ba07d4fff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Mon, 9 Jul 2018 17:00:05 +0200 Subject: [PATCH] Tests: Properly use sinon sandbox in tests. --- tests/linkui.js | 4 ++-- tests/ui/linkactionsview.js | 4 ++-- tests/ui/linkformview.js | 4 ++-- tests/unlinkcommand.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/linkui.js b/tests/linkui.js index 16880b5..11d4f15 100644 --- a/tests/linkui.js +++ b/tests/linkui.js @@ -22,11 +22,11 @@ import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; import Range from '@ckeditor/ckeditor5-engine/src/view/range'; import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver'; -testUtils.createSinonSandbox(); - describe( 'LinkUI', () => { let editor, linkUIFeature, linkButton, balloon, formView, actionsView, editorElement; + testUtils.createSinonSandbox(); + beforeEach( () => { editorElement = document.createElement( 'div' ); document.body.appendChild( editorElement ); diff --git a/tests/ui/linkactionsview.js b/tests/ui/linkactionsview.js index 0510af8..fde424e 100644 --- a/tests/ui/linkactionsview.js +++ b/tests/ui/linkactionsview.js @@ -12,11 +12,11 @@ import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils'; -testUtils.createSinonSandbox(); - describe( 'LinkActionsView', () => { let view; + testUtils.createSinonSandbox(); + beforeEach( () => { view = new LinkActionsView( { t: val => val } ); view.render(); diff --git a/tests/ui/linkformview.js b/tests/ui/linkformview.js index 9252a0d..f7c6e66 100644 --- a/tests/ui/linkformview.js +++ b/tests/ui/linkformview.js @@ -14,11 +14,11 @@ import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils'; -testUtils.createSinonSandbox(); - describe( 'LinkFormView', () => { let view; + testUtils.createSinonSandbox(); + beforeEach( () => { view = new LinkFormView( { t: val => val } ); view.render(); diff --git a/tests/unlinkcommand.js b/tests/unlinkcommand.js index 6e846e2..a5ba3a8 100644 --- a/tests/unlinkcommand.js +++ b/tests/unlinkcommand.js @@ -8,11 +8,11 @@ import UnlinkCommand from '../src/unlinkcommand'; import { setData, getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model'; import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils'; -testUtils.createSinonSandbox(); - describe( 'UnlinkCommand', () => { let editor, model, document, command; + testUtils.createSinonSandbox(); + beforeEach( () => { return ModelTestEditor.create() .then( newEditor => {