浏览代码

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 );
 	} );
 } );