Jelajahi Sumber

Improved code style.

Oskar Wróbel 8 tahun lalu
induk
melakukan
1c15bf3f9a

+ 7 - 4
packages/ckeditor5-ui/src/contextualballoon.js

@@ -29,6 +29,13 @@ import nth from '@ckeditor/ckeditor5-utils/src/nth';
  * @extends module:core/plugin~Plugin
  */
 export default class ContextualBalloon extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'contextualballoon';
+	}
+
 	/**
 	 * @inheritDoc
 	 */
@@ -54,10 +61,6 @@ export default class ContextualBalloon extends Plugin {
 		this.editor.ui.view.body.add( this.view );
 	}
 
-	static get pluginName() {
-		return 'contextualballoon';
-	}
-
 	/**
 	 * Returns the currently visible view or `null` when there are no
 	 * views in the stack.

+ 3 - 2
packages/ckeditor5-ui/tests/contextualballoon.js

@@ -39,13 +39,14 @@ describe( 'ContextualBalloon', () => {
 		editor.destroy();
 	} );
 
-	it( 'should be a plugin instance', () => {
+	it( 'should create a plugin instance', () => {
 		expect( balloon ).to.instanceof( Plugin );
+		expect( balloon ).to.instanceof( ContextualBalloon );
 	} );
 
 	describe( 'pluginName', () => {
 		it( 'should return plugin by name', () => {
-			expect( editor.plugins.get( 'contextualballoon' ) ).to.instanceof( ContextualBalloon );
+			expect( editor.plugins.get( 'contextualballoon' ) ).to.equal( balloon );
 		} );
 	} );