|
@@ -20,11 +20,15 @@ describe( 'BalloonPanelView', () => {
|
|
|
beforeEach( () => {
|
|
beforeEach( () => {
|
|
|
view = new BalloonPanelView();
|
|
view = new BalloonPanelView();
|
|
|
|
|
|
|
|
|
|
+ global.document.body.appendChild( view.element );
|
|
|
|
|
+
|
|
|
return view.init();
|
|
return view.init();
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
afterEach( () => {
|
|
afterEach( () => {
|
|
|
if ( view ) {
|
|
if ( view ) {
|
|
|
|
|
+ view.element.remove();
|
|
|
|
|
+
|
|
|
return view.destroy();
|
|
return view.destroy();
|
|
|
}
|
|
}
|
|
|
} );
|
|
} );
|
|
@@ -167,6 +171,9 @@ describe( 'BalloonPanelView', () => {
|
|
|
limiter = document.createElement( 'div' );
|
|
limiter = document.createElement( 'div' );
|
|
|
target = document.createElement( 'div' );
|
|
target = document.createElement( 'div' );
|
|
|
|
|
|
|
|
|
|
+ global.document.body.appendChild( limiter );
|
|
|
|
|
+ global.document.body.appendChild( target );
|
|
|
|
|
+
|
|
|
// Mock balloon panel element dimensions.
|
|
// Mock balloon panel element dimensions.
|
|
|
mockBoundingBox( view.element, {
|
|
mockBoundingBox( view.element, {
|
|
|
top: 0,
|
|
top: 0,
|
|
@@ -189,6 +196,11 @@ describe( 'BalloonPanelView', () => {
|
|
|
testUtils.sinon.stub( global, 'window' ).value( windowStub );
|
|
testUtils.sinon.stub( global, 'window' ).value( windowStub );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ afterEach( () => {
|
|
|
|
|
+ limiter.remove();
|
|
|
|
|
+ target.remove();
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
it( 'should use default options', () => {
|
|
it( 'should use default options', () => {
|
|
|
const spy = testUtils.sinon.spy( positionUtils, 'getOptimalPosition' );
|
|
const spy = testUtils.sinon.spy( positionUtils, 'getOptimalPosition' );
|
|
|
|
|
|