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

Add test for image upload button accepted mime-types.

Maciej Gołaszewski 6 лет назад
Родитель
Сommit
99c316df08
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      packages/ckeditor5-image/tests/imageupload/imageuploadui.js

+ 8 - 0
packages/ckeditor5-image/tests/imageupload/imageuploadui.js

@@ -62,6 +62,14 @@ describe( 'ImageUploadUI', () => {
 		expect( button ).to.be.instanceOf( FileDialogButtonView );
 	} );
 
+	it( 'should set proper accepted mime-types for imageUpload button as defined in configuration', () => {
+		editor.config.set( 'image.upload.types', [ 'svg+xml', 'jpeg', 'vnd.microsoft.icon', 'x-xbitmap' ] );
+
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
+
+		expect( button.acceptedType ).to.equal( 'image/svg+xml,image/jpeg,image/vnd.microsoft.icon,image/x-xbitmap' );
+	} );
+
 	it( 'should be disabled while ImageUploadCommand is disabled', () => {
 		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const command = editor.commands.get( 'imageUpload' );