From b34ed91f9adb4b15ac29c0626084e790be580283 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Mon, 21 Aug 2017 11:31:05 +0200 Subject: [PATCH] Tests: Code refactoring in the BalloonPanelView tests to suppress Rect utility warnings (see: ckeditor/ckeditor5-utils#178). --- tests/panel/balloon/balloonpanelview.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/panel/balloon/balloonpanelview.js b/tests/panel/balloon/balloonpanelview.js index d57e7a77..ec5ae8f2 100644 --- a/tests/panel/balloon/balloonpanelview.js +++ b/tests/panel/balloon/balloonpanelview.js @@ -20,11 +20,15 @@ describe( 'BalloonPanelView', () => { beforeEach( () => { view = new BalloonPanelView(); + global.document.body.appendChild( view.element ); + return view.init(); } ); afterEach( () => { if ( view ) { + view.element.remove(); + return view.destroy(); } } ); @@ -167,6 +171,9 @@ describe( 'BalloonPanelView', () => { limiter = document.createElement( 'div' ); target = document.createElement( 'div' ); + global.document.body.appendChild( limiter ); + global.document.body.appendChild( target ); + // Mock balloon panel element dimensions. mockBoundingBox( view.element, { top: 0, @@ -189,6 +196,11 @@ describe( 'BalloonPanelView', () => { testUtils.sinon.stub( global, 'window' ).value( windowStub ); } ); + afterEach( () => { + limiter.remove(); + target.remove(); + } ); + it( 'should use default options', () => { const spy = testUtils.sinon.spy( positionUtils, 'getOptimalPosition' );