Procházet zdrojové kódy

Code style: Aligned code style to new ESLint version.

Piotrek Koszuliński před 8 roky
rodič
revize
7e8d22ab5f

+ 21 - 20
packages/ckeditor5-link/tests/link.js

@@ -28,26 +28,27 @@ describe( 'Link', () => {
 		editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ Link, Paragraph ]
-		} )
-		.then( newEditor => {
-			newEditor.editing.view.attachDomRoot( editorElement );
-
-			editor = newEditor;
-
-			linkFeature = editor.plugins.get( Link );
-			linkButton = editor.ui.componentFactory.create( 'link' );
-			unlinkButton = editor.ui.componentFactory.create( 'unlink' );
-			balloon = editor.plugins.get( ContextualBalloon );
-			formView = linkFeature.formView;
-
-			// There is no point to execute BalloonPanelView attachTo and pin methods so lets override it.
-			testUtils.sinon.stub( balloon.view, 'attachTo' ).returns( {} );
-			testUtils.sinon.stub( balloon.view, 'pin' ).returns( {} );
-
-			formView.init();
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ Link, Paragraph ]
+			} )
+			.then( newEditor => {
+				newEditor.editing.view.attachDomRoot( editorElement );
+
+				editor = newEditor;
+
+				linkFeature = editor.plugins.get( Link );
+				linkButton = editor.ui.componentFactory.create( 'link' );
+				unlinkButton = editor.ui.componentFactory.create( 'unlink' );
+				balloon = editor.plugins.get( ContextualBalloon );
+				formView = linkFeature.formView;
+
+				// There is no point to execute BalloonPanelView attachTo and pin methods so lets override it.
+				testUtils.sinon.stub( balloon.view, 'attachTo' ).returns( {} );
+				testUtils.sinon.stub( balloon.view, 'pin' ).returns( {} );
+
+				formView.init();
+			} );
 	} );
 
 	afterEach( () => {

+ 2 - 2
packages/ckeditor5-link/tests/linkcommand.js

@@ -151,8 +151,8 @@ describe( 'LinkCommand', () => {
 				expect( command.value ).to.equal( 'url' );
 			} );
 
-			it(
-				'should overwrite `linkHref` attribute of selected text only, when selection start inside text with `linkHref` attribute',
+			it( 'should overwrite `linkHref` attribute of selected text only, ' +
+				'when selection start inside text with `linkHref` attribute',
 			() => {
 				setData( document, 'f<$text linkHref="other url">o[o</$text>ba]r' );
 

+ 11 - 10
packages/ckeditor5-link/tests/manual/link.js

@@ -12,13 +12,14 @@ import Link from '../../src/link';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Undo from '@ckeditor/ckeditor5-undo/src/undo';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Link, Typing, Paragraph, Undo, Enter ],
-	toolbar: [ 'link', 'unlink', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Link, Typing, Paragraph, Undo, Enter ],
+		toolbar: [ 'link', 'unlink', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 28 - 26
packages/ckeditor5-link/tests/manual/tickets/113/1.js

@@ -14,34 +14,36 @@ import Position from '@ckeditor/ckeditor5-engine/src/model/position';
 import Range from '@ckeditor/ckeditor5-engine/src/model/range';
 
 // Editor for the external insert.
-ClassicEditor.create( document.querySelector( '#editor-insert' ), {
-	plugins: [ ArticlePresets ],
-	toolbar: [ 'undo', 'redo', 'link' ]
-} )
-.then( editor => {
-	const element = document.querySelector( '#button-insert' );
-
-	element.addEventListener( 'click', () => {
-		element.disabled = true;
-		startExternalInsert( editor );
-	} );
-} )
-.catch( err => console.error( err.stack ) );
+ClassicEditor
+	.create( document.querySelector( '#editor-insert' ), {
+		plugins: [ ArticlePresets ],
+		toolbar: [ 'undo', 'redo', 'link' ]
+	} )
+	.then( editor => {
+		const element = document.querySelector( '#button-insert' );
+
+		element.addEventListener( 'click', () => {
+			element.disabled = true;
+			startExternalInsert( editor );
+		} );
+	} )
+	.catch( err => console.error( err.stack ) );
 
 // Editor for the external delete.
-ClassicEditor.create( document.querySelector( '#editor-delete' ), {
-	plugins: [ ArticlePresets ],
-	toolbar: [ 'undo', 'redo', 'link' ]
-} )
-.then( editor => {
-	const element = document.querySelector( '#button-delete' );
-
-	element.addEventListener( 'click', () => {
-		element.disabled = true;
-		startExternalDelete( editor );
-	} );
-} )
-.catch( err => console.error( err.stack ) );
+ClassicEditor
+	.create( document.querySelector( '#editor-delete' ), {
+		plugins: [ ArticlePresets ],
+		toolbar: [ 'undo', 'redo', 'link' ]
+	} )
+	.then( editor => {
+		const element = document.querySelector( '#button-delete' );
+
+		element.addEventListener( 'click', () => {
+			element.disabled = true;
+			startExternalDelete( editor );
+		} );
+	} )
+	.catch( err => console.error( err.stack ) );
 
 function wait( delay ) {
 	return new Promise( resolve => {

+ 2 - 3
packages/ckeditor5-link/tests/unlinkcommand.js

@@ -140,9 +140,8 @@ describe( 'UnlinkCommand', () => {
 					);
 			} );
 
-			it(
-				'should remove `linkHref` attribute from selection siblings with the same attribute value and do nothing with other ' +
-				'attributes',
+			it( 'should remove `linkHref` attribute from selection siblings with the same attribute value ' +
+				'and do nothing with other attributes',
 			() => {
 				setData(
 					document,