소스 검색

Fixed a broken test.

Piotrek Koszuliński 9 년 전
부모
커밋
1b545bce73
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      packages/ckeditor5-utils/tests/dom/getancestors.js

+ 5 - 1
packages/ckeditor5-utils/tests/dom/getancestors.js

@@ -37,7 +37,9 @@ describe( 'getAncestors', () => {
 	} );
 
 	it( 'should not return any non-Node, non-DocumentFragment object if given node is in iframe', () => {
-		const iframe = document.getElementsByTagName( 'iframe' )[ 0 ];
+		const iframe = document.createElement( 'iframe' );
+		document.body.appendChild( iframe );
+
 		const iframeDoc = iframe.contentWindow.document;
 
 		const span = createElement( iframeDoc, 'span' );
@@ -46,5 +48,7 @@ describe( 'getAncestors', () => {
 		const ancestors = getAncestors( span );
 
 		expect( ancestors.includes( iframeDoc ) ).to.be.false;
+
+		document.body.removeChild( iframe );
 	} );
 } );