瀏覽代碼

Tests: Fix test for Edge.

Krzysztof Krztoń 7 年之前
父節點
當前提交
ae3c045634
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      packages/ckeditor5-image/tests/imageupload/imageuploadediting.js

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

@@ -776,7 +776,12 @@ describe( 'ImageUploadEditing', () => {
 	} );
 
 	it( 'should not upload and remove image when `File` constructor is not supported', done => {
-		testUtils.sinon.stub( window, 'File' ).throws( 'Function expected.' );
+		if ( isEdgeEnv ) {
+			// Since on Edge `File` is already stubbed, restore it so that excpetion will be thrown.
+			testUtils.sinon.restore();
+		} else {
+			testUtils.sinon.stub( window, 'File' ).throws( 'Function expected.' );
+		}
 
 		const notification = editor.plugins.get( Notification );