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

Code style: Aligned code style to new ESLint version.

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

+ 32 - 29
packages/ckeditor5-heading/tests/headingengine.js

@@ -14,13 +14,14 @@ describe( 'HeadingEngine', () => {
 	let editor, document;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( {
-			plugins: [ HeadingEngine ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			document = editor.document;
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ HeadingEngine ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				document = editor.document;
+			} );
 	} );
 
 	it( 'should be loaded', () => {
@@ -75,9 +76,10 @@ describe( 'HeadingEngine', () => {
 	} );
 
 	it( 'should not blow up if there\'s no enter command in the editor', () => {
-		return VirtualTestEditor.create( {
-			plugins: [ HeadingEngine ]
-		} );
+		return VirtualTestEditor
+			.create( {
+				plugins: [ HeadingEngine ]
+			} );
 	} );
 
 	describe( 'config', () => {
@@ -99,25 +101,26 @@ describe( 'HeadingEngine', () => {
 					{ modelElement: 'h4', viewElement: 'h4', title: 'H4' }
 				];
 
-				return VirtualTestEditor.create( {
-					plugins: [ HeadingEngine ],
-					heading: {
-						options
-					}
-				} )
-				.then( editor => {
-					document = editor.document;
-
-					expect( editor.commands.get( 'h4' ) ).to.be.instanceOf( HeadingCommand );
-					expect( editor.commands.get( 'paragraph' ) ).to.be.instanceOf( ParagraphCommand );
-
-					expect( document.schema.hasItem( 'paragraph' ) ).to.be.true;
-					expect( document.schema.hasItem( 'h4' ) ).to.be.true;
-
-					expect( document.schema.hasItem( 'heading1' ) ).to.be.false;
-					expect( document.schema.hasItem( 'heading2' ) ).to.be.false;
-					expect( document.schema.hasItem( 'heading3' ) ).to.be.false;
-				} );
+				return VirtualTestEditor
+					.create( {
+						plugins: [ HeadingEngine ],
+						heading: {
+							options
+						}
+					} )
+					.then( editor => {
+						document = editor.document;
+
+						expect( editor.commands.get( 'h4' ) ).to.be.instanceOf( HeadingCommand );
+						expect( editor.commands.get( 'paragraph' ) ).to.be.instanceOf( ParagraphCommand );
+
+						expect( document.schema.hasItem( 'paragraph' ) ).to.be.true;
+						expect( document.schema.hasItem( 'h4' ) ).to.be.true;
+
+						expect( document.schema.hasItem( 'heading1' ) ).to.be.false;
+						expect( document.schema.hasItem( 'heading2' ) ).to.be.false;
+						expect( document.schema.hasItem( 'heading3' ) ).to.be.false;
+					} );
 			} );
 		} );
 	} );

+ 20 - 18
packages/ckeditor5-heading/tests/tickets/40.js

@@ -16,32 +16,34 @@ describe( 'Bug ckeditor5-heading#40', () => {
 	} );
 
 	it( 'enter at the end of a heading creates a paragraph, when heading was loaded before enter', () => {
-		return VirtualTestEditor.create( {
-			plugins: [ HeadingEngine, Enter ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
+		return VirtualTestEditor
+			.create( {
+				plugins: [ HeadingEngine, Enter ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
 
-			setData( editor.document, '<heading1>foo[]</heading1>' );
+				setData( editor.document, '<heading1>foo[]</heading1>' );
 
-			editor.execute( 'enter' );
+				editor.execute( 'enter' );
 
-			expect( getData( editor.document ) ).to.equal( '<heading1>foo</heading1><paragraph>[]</paragraph>' );
-		} );
+				expect( getData( editor.document ) ).to.equal( '<heading1>foo</heading1><paragraph>[]</paragraph>' );
+			} );
 	} );
 
 	it( 'enter at the end of a heading creates a paragraph, when enter was loaded before heading', () => {
-		return VirtualTestEditor.create( {
-			plugins: [ Enter, HeadingEngine ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
+		return VirtualTestEditor
+			.create( {
+				plugins: [ Enter, HeadingEngine ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
 
-			setData( editor.document, '<heading1>foo[]</heading1>' );
+				setData( editor.document, '<heading1>foo[]</heading1>' );
 
-			editor.execute( 'enter' );
+				editor.execute( 'enter' );
 
-			expect( getData( editor.document ) ).to.equal( '<heading1>foo</heading1><paragraph>[]</paragraph>' );
-		} );
+				expect( getData( editor.document ) ).to.equal( '<heading1>foo</heading1><paragraph>[]</paragraph>' );
+			} );
 	} );
 } );