소스 검색

Tests: Fix stubbing for Edge test.

Krzysztof Krztoń 7 년 전
부모
커밋
77842d1b68
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      packages/ckeditor5-image/tests/imageupload/imageuploadediting.js

+ 3 - 1
packages/ckeditor5-image/tests/imageupload/imageuploadediting.js

@@ -777,8 +777,10 @@ describe( 'ImageUploadEditing', () => {
 
 
 	it( 'should not upload and remove image when `File` constructor is not supported', done => {
 	it( 'should not upload and remove image when `File` constructor is not supported', done => {
 		if ( isEdgeEnv ) {
 		if ( isEdgeEnv ) {
-			// Since on Edge `File` is already stubbed, restore it so that excpetion will be thrown.
+			// Since on Edge `File` is already stubbed, restore it to it native form so that exception will be thrown.
 			testUtils.sinon.restore();
 			testUtils.sinon.restore();
+			// Since all stubs were restored, re-stub `scrollToTheSelection`.
+			testUtils.sinon.stub( editor.editing.view, 'scrollToTheSelection' ).callsFake( () => {} );
 		} else {
 		} else {
 			testUtils.sinon.stub( window, 'File' ).throws( 'Function expected.' );
 			testUtils.sinon.stub( window, 'File' ).throws( 'Function expected.' );
 		}
 		}