瀏覽代碼

Merge pull request #212 from ckeditor/t/196

Tests: Fixed failed tests on other browsers than Chrome when using BrowserStack. Closes #196.
Szymon Kupś 8 年之前
父節點
當前提交
e155263a15
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 5 2
      packages/ckeditor5-utils/tests/dom/rect.js
  2. 3 0
      packages/ckeditor5-utils/tests/dom/scroll.js

+ 5 - 2
packages/ckeditor5-utils/tests/dom/rect.js

@@ -435,7 +435,7 @@ describe( 'Rect', () => {
 			ancestorA = document.createElement( 'div' );
 			ancestorB = document.createElement( 'div' );
 
-			ancestorA.append( element );
+			ancestorA.appendChild( element );
 			document.body.appendChild( ancestorA );
 		} );
 
@@ -575,7 +575,7 @@ describe( 'Rect', () => {
 		} );
 
 		it( 'should return the visible rect (HTMLElement), partially cropped, deep ancestor overflow', () => {
-			ancestorB.append( ancestorA );
+			ancestorB.appendChild( ancestorA );
 			document.body.appendChild( ancestorB );
 
 			testUtils.sinon.stub( element, 'getBoundingClientRect' ).returns( {
@@ -909,6 +909,9 @@ describe( 'Rect', () => {
 					height: 230
 				} );
 
+				// Safari fails because of "afterEach()" hook tries to restore values from removed element.
+				// We need to restore these values manually.
+				testUtils.sinon.restore();
 				iframe.remove();
 				done();
 			} );

+ 3 - 0
packages/ckeditor5-utils/tests/dom/scroll.js

@@ -248,6 +248,9 @@ describe( 'scrollViewportToShowTarget()', () => {
 		} );
 
 		afterEach( () => {
+			// Safari fails because of "afterEach()" hook tries to restore values from removed element.
+			// We need to restore these values manually.
+			testUtils.sinon.restore();
 			iframeAncestor.remove();
 		} );