瀏覽代碼

Code style: Aligned code style to new ESLint version.

Piotrek Koszuliński 8 年之前
父節點
當前提交
455e213c18

+ 7 - 6
packages/ckeditor5-upload/tests/imageupload.js

@@ -18,12 +18,13 @@ describe( 'ImageUpload', () => {
 		const editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicEditor.create( editorElement, {
-			plugins: [ Image, ImageUpload ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-		} );
+		return ClassicEditor
+			.create( editorElement, {
+				plugins: [ Image, ImageUpload ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
 	} );
 
 	it( 'should include ImageUploadProgress', () => {

+ 18 - 17
packages/ckeditor5-upload/tests/imageuploadcommand.js

@@ -17,23 +17,24 @@ describe( 'ImageUploadCommand', () => {
 	let editor, command, doc, fileRepository;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( {
-			plugins: [ FileRepository, Image, Paragraph ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			command = new ImageUploadCommand( editor );
-			fileRepository = editor.plugins.get( FileRepository );
-			fileRepository.createAdapter = loader => {
-				return new AdapterMock( loader );
-			};
-
-			doc = editor.document;
-
-			const schema = doc.schema;
-			schema.allow( { name: 'image', attributes: [ 'uploadId' ], inside: '$root' } );
-			schema.requireAttributes( 'image', [ 'uploadId' ] );
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ FileRepository, Image, Paragraph ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				command = new ImageUploadCommand( editor );
+				fileRepository = editor.plugins.get( FileRepository );
+				fileRepository.createAdapter = loader => {
+					return new AdapterMock( loader );
+				};
+
+				doc = editor.document;
+
+				const schema = doc.schema;
+				schema.allow( { name: 'image', attributes: [ 'uploadId' ], inside: '$root' } );
+				schema.requireAttributes( 'image', [ 'uploadId' ] );
+			} );
 	} );
 
 	afterEach( () => {

+ 17 - 16
packages/ckeditor5-upload/tests/imageuploadengine.js

@@ -37,22 +37,23 @@ describe( 'ImageUploadEngine', () => {
 			return nativeReaderMock;
 		} );
 
-		return ClassicTestEditor.create( {
-			plugins: [ ImageEngine, ImageUploadEngine, Paragraph, UndoEngine ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			viewDocument = editor.editing.view;
-
-			fileRepository = editor.plugins.get( FileRepository );
-			fileRepository.createAdapter = newLoader => {
-				loader = newLoader;
-				adapterMock = new AdapterMock( loader );
-
-				return adapterMock;
-			};
-		} );
+		return ClassicTestEditor
+			.create( {
+				plugins: [ ImageEngine, ImageUploadEngine, Paragraph, UndoEngine ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				viewDocument = editor.editing.view;
+
+				fileRepository = editor.plugins.get( FileRepository );
+				fileRepository.createAdapter = newLoader => {
+					loader = newLoader;
+					adapterMock = new AdapterMock( loader );
+
+					return adapterMock;
+				};
+			} );
 	} );
 
 	it( 'should register proper schema rules', () => {

+ 17 - 16
packages/ckeditor5-upload/tests/imageuploadprogress.js

@@ -31,22 +31,23 @@ describe( 'ImageUploadProgress', () => {
 			return nativeReaderMock;
 		} );
 
-		return ClassicTestEditor.create( {
-			plugins: [ ImageEngine, Paragraph, ImageUploadProgress ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			document = editor.document;
-			viewDocument = editor.editing.view;
-
-			fileRepository = editor.plugins.get( FileRepository );
-			fileRepository.createAdapter = newLoader => {
-				loader = newLoader;
-				adapterMock = new AdapterMock( loader );
-
-				return adapterMock;
-			};
-		} );
+		return ClassicTestEditor
+			.create( {
+				plugins: [ ImageEngine, Paragraph, ImageUploadProgress ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				document = editor.document;
+				viewDocument = editor.editing.view;
+
+				fileRepository = editor.plugins.get( FileRepository );
+				fileRepository.createAdapter = newLoader => {
+					loader = newLoader;
+					adapterMock = new AdapterMock( loader );
+
+					return adapterMock;
+				};
+			} );
 	} );
 
 	it( 'should include ImageUploadEngine', () => {

+ 22 - 21
packages/ckeditor5-upload/tests/manual/imageupload.js

@@ -24,28 +24,29 @@ import { AdapterMock } from '../_utils/mocks';
 
 const buttonContainer = document.getElementById( 'button-container' );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [
-		Enter, Typing, Paragraph, Heading, Undo, Bold, Italic, Heading, List, Image, ImageToolbar, Clipboard,
-		ImageCaption, ImageStyle, ImageUpload
-	],
-	toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList', 'insertImage' ],
-	image: {
-		toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
-	}
-} )
-.then( editor => {
-	// Register fake adapter.
-	editor.plugins.get( 'FileRepository' ).createAdapter = loader => {
-		const adapterMock = new AdapterMock( loader );
-		createProgressButton( loader, adapterMock );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [
+			Enter, Typing, Paragraph, Heading, Undo, Bold, Italic, Heading, List, Image, ImageToolbar, Clipboard,
+			ImageCaption, ImageStyle, ImageUpload
+		],
+		toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList', 'insertImage' ],
+		image: {
+			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+		}
+	} )
+	.then( editor => {
+		// Register fake adapter.
+		editor.plugins.get( 'FileRepository' ).createAdapter = loader => {
+			const adapterMock = new AdapterMock( loader );
+			createProgressButton( loader, adapterMock );
 
-		return adapterMock;
-	};
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+			return adapterMock;
+		};
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
 
 function createProgressButton( loader, adapterMock ) {
 	const fileName = loader.file.name;

+ 6 - 5
packages/ckeditor5-upload/tests/ui/filedialogbuttonview.js

@@ -15,12 +15,13 @@ describe( 'FileDialogButtonView', () => {
 		const editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicEditor.create( editorElement )
-		.then( newEditor => {
-			editor = newEditor;
+		return ClassicEditor
+			.create( editorElement )
+			.then( newEditor => {
+				editor = newEditor;
 
-			view = new FileDialogButtonView( editor.locale );
-		} );
+				view = new FileDialogButtonView( editor.locale );
+			} );
 	} );
 
 	it( 'should append input view to document body', () => {