8
0
Просмотр исходного кода

Better manual test checking if placeholder can be displayed as img.src attribute.

Szymon Kupś 8 лет назад
Родитель
Сommit
5be8868ea9
1 измененных файлов с 12 добавлено и 4 удалено
  1. 12 4
      packages/ckeditor5-upload/tests/manual/imageplaceholder.js

+ 12 - 4
packages/ckeditor5-upload/tests/manual/imageplaceholder.js

@@ -5,9 +5,17 @@
 
 /* global document */
 
-import placeholder from '../../theme/icons/image_placeholder.svg';
+import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
+import ImageEngine from '@ckeditor/ckeditor5-image/src/image/imageengine';
+import ImageUploadEngine from '../../src/imageuploadengine';
+import ImageUploadProgress from '../../src/imageuploadprogress';
 
-const img = document.createElement( 'img' );
-img.src = 'data:image/svg+xml;utf8,' + encodeURIComponent( placeholder );
+ClassicTestEditor.create( { plugins: [ ImageEngine, ImageUploadEngine, ImageUploadProgress ] } )
+	.then( editor => {
+		const imageUploadProgress = editor.plugins.get( ImageUploadProgress );
+		const img = document.createElement( 'img' );
+
+		img.src = imageUploadProgress.placeholder;
+		document.getElementById( 'container' ).appendChild( img );
+	} );
 
-document.getElementById( 'container' ).appendChild( img );