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

Merge pull request #277 from ckeditor/t/ckeditor5/1336

Internal: Added names to the plugins that expose a public API (see ckeditor/ckeditor5#1336).
Maciej 7 лет назад
Родитель
Сommit
d842616dd1

+ 7 - 0
packages/ckeditor5-image/src/imagestyle/imagestyleui.js

@@ -20,6 +20,13 @@ import '../../theme/imagestyle.css';
  * @extends module:core/plugin~Plugin
  */
 export default class ImageStyleUI extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'ImageStyleUI';
+	}
+
 	/**
 	 * Returns the default localized style titles provided by the plugin.
 	 *

+ 7 - 0
packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js

@@ -31,6 +31,13 @@ export default class ImageTextAlternativeUI extends Plugin {
 		return [ ContextualBalloon ];
 	}
 
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'ImageTextAlternativeUI';
+	}
+
 	/**
 	 * @inheritDoc
 	 */

+ 4 - 0
packages/ckeditor5-image/tests/imagestyle/imagestyleui.js

@@ -41,6 +41,10 @@ describe( 'ImageStyleUI', () => {
 		return editor.destroy();
 	} );
 
+	it( 'should be named', () => {
+		expect( ImageStyleUI.pluginName ).to.equal( 'ImageStyleUI' );
+	} );
+
 	it( 'should register buttons for each style', () => {
 		const spy = sinon.spy( editor, 'execute' );
 

+ 4 - 0
packages/ckeditor5-image/tests/imagetextalternative/imagetextalternativeui.js

@@ -45,6 +45,10 @@ describe( 'ImageTextAlternative', () => {
 		return editor.destroy();
 	} );
 
+	it( 'should be named', () => {
+		expect( ImageTextAlternativeUI.pluginName ).to.equal( 'ImageTextAlternativeUI' );
+	} );
+
 	describe( 'toolbar button', () => {
 		it( 'should be registered in component factory', () => {
 			expect( button ).to.be.instanceOf( ButtonView );