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

Commit

Permalink
Tests: Code refactoring in the BalloonPanelView tests to suppress Rec…
Browse files Browse the repository at this point in the history
…t utility warnings (see: ckeditor/ckeditor5-utils#178).
  • Loading branch information
oleq authored and Reinmar committed Aug 22, 2017
1 parent 322563e commit b34ed91
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/panel/balloon/balloonpanelview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
} );
Expand Down Expand Up @@ -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,
Expand All @@ -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' );

Expand Down

0 comments on commit b34ed91

Please # to comment.