ソースを参照

Tests: Code refactoring in the BalloonPanelView tests to suppress Rect utility warnings (see: ckeditor/ckeditor5-utils#178).

Aleksander Nowodzinski 8 年 前
コミット
80f5eb1440

+ 12 - 0
packages/ckeditor5-ui/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' );