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

Code style: Aligned code style to new ESLint version.

Kamil Piechaczek 8 лет назад
Родитель
Сommit
db5325d904

+ 8 - 7
packages/ckeditor5-block-quote/tests/blockquote.js

@@ -17,13 +17,14 @@ describe( 'BlockQuote', () => {
 		element = document.createElement( 'div' );
 		document.body.appendChild( element );
 
-		return ClassicTestEditor.create( element, {
-			plugins: [ BlockQuote ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			command = editor.commands.get( 'blockQuote' );
-		} );
+		return ClassicTestEditor
+			.create( element, {
+				plugins: [ BlockQuote ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				command = editor.commands.get( 'blockQuote' );
+			} );
 	} );
 
 	afterEach( () => {

+ 24 - 23
packages/ckeditor5-block-quote/tests/blockquotecommand.js

@@ -18,37 +18,38 @@ describe( 'BlockQuoteCommand', () => {
 	let editor, doc, command;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( {
-			plugins: [ BlockQuoteEngine ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
+		return VirtualTestEditor
+			.create( {
+				plugins: [ BlockQuoteEngine ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
 
-			doc = editor.document;
+				doc = editor.document;
 
-			doc.schema.registerItem( 'paragraph', '$block' );
-			doc.schema.registerItem( 'heading', '$block' );
-			doc.schema.registerItem( 'widget' );
+				doc.schema.registerItem( 'paragraph', '$block' );
+				doc.schema.registerItem( 'heading', '$block' );
+				doc.schema.registerItem( 'widget' );
 
-			doc.schema.allow( { name: 'widget', inside: '$root' } );
-			doc.schema.allow( { name: '$text', inside: 'widget' } );
+				doc.schema.allow( { name: 'widget', inside: '$root' } );
+				doc.schema.allow( { name: '$text', inside: 'widget' } );
 
-			doc.schema.limits.add( 'widget' );
+				doc.schema.limits.add( 'widget' );
 
-			buildModelConverter().for( editor.editing.modelToView )
-				.fromElement( 'paragraph' )
-				.toElement( 'p' );
+				buildModelConverter().for( editor.editing.modelToView )
+					.fromElement( 'paragraph' )
+					.toElement( 'p' );
 
-			buildModelConverter().for( editor.editing.modelToView )
-				.fromElement( 'heading' )
-				.toElement( 'h' );
+				buildModelConverter().for( editor.editing.modelToView )
+					.fromElement( 'heading' )
+					.toElement( 'h' );
 
-			buildModelConverter().for( editor.editing.modelToView )
-				.fromElement( 'widget' )
-				.toElement( 'widget' );
+				buildModelConverter().for( editor.editing.modelToView )
+					.fromElement( 'widget' )
+					.toElement( 'widget' );
 
-			command = editor.commands.get( 'blockQuote' );
-		} );
+				command = editor.commands.get( 'blockQuote' );
+			} );
 	} );
 
 	afterEach( () => {

+ 18 - 16
packages/ckeditor5-block-quote/tests/blockquoteengine.js

@@ -16,14 +16,15 @@ describe( 'BlockQuoteEngine', () => {
 	let editor, doc;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( {
-			plugins: [ BlockQuoteEngine, Paragraph ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-
-			doc = editor.document;
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ BlockQuoteEngine, Paragraph ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+
+				doc = editor.document;
+			} );
 	} );
 
 	afterEach( () => {
@@ -59,13 +60,14 @@ describe( 'BlockQuoteEngine', () => {
 	} );
 
 	it( 'allows list items inside blockQuote', () => {
-		return VirtualTestEditor.create( {
-			plugins: [ BlockQuoteEngine, Paragraph, ListEngine ]
-		} )
-		.then( editor => {
-			editor.setData( '<blockquote><ul><li>xx</li></ul></blockquote>' );
-
-			expect( editor.getData() ).to.equal( '<blockquote><ul><li>xx</li></ul></blockquote>' );
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ BlockQuoteEngine, Paragraph, ListEngine ]
+			} )
+			.then( editor => {
+				editor.setData( '<blockquote><ul><li>xx</li></ul></blockquote>' );
+
+				expect( editor.getData() ).to.equal( '<blockquote><ul><li>xx</li></ul></blockquote>' );
+			} );
 	} );
 } );

+ 12 - 10
packages/ckeditor5-block-quote/tests/integration.js

@@ -23,13 +23,14 @@ describe( 'BlockQuote', () => {
 		element = document.createElement( 'div' );
 		document.body.appendChild( element );
 
-		return ClassicTestEditor.create( element, {
-			plugins: [ BlockQuote, Paragraph, Image, ImageCaption, List, Enter, Delete ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-		} );
+		return ClassicTestEditor
+			.create( element, {
+				plugins: [ BlockQuote, Paragraph, Image, ImageCaption, List, Enter, Delete ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+			} );
 	} );
 
 	afterEach( () => {
@@ -298,9 +299,10 @@ describe( 'BlockQuote', () => {
 			document.body.appendChild( element );
 
 			// We can't load ImageCaption in this test because it adds <caption> to all images automatically.
-			return ClassicTestEditor.create( element, {
-				plugins: [ BlockQuote, Paragraph, Image ]
-			} )
+			return ClassicTestEditor
+				.create( element, {
+					plugins: [ BlockQuote, Paragraph, Image ]
+				} )
 				.then( editor => {
 					setModelData( editor.document,
 						'<paragraph>fo[o</paragraph>' +

+ 13 - 12
packages/ckeditor5-block-quote/tests/manual/blockquote.js

@@ -10,18 +10,19 @@ import ArticlePreset from '@ckeditor/ckeditor5-presets/src/article';
 
 import { getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [
-		ArticlePreset
-	],
-	toolbar: [ 'headings', 'bold', 'italic', 'link', 'unlink', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [
+			ArticlePreset
+		],
+		toolbar: [ 'headings', 'bold', 'italic', 'link', 'unlink', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
 
 window.setInterval( function() {
 	console.log( getData( window.editor.document ) );