ソースを参照

Added plugin name.

Maciej Bukowski 7 年 前
コミット
ef84547fe4

+ 7 - 0
packages/ckeditor5-cloud-services/src/cloudservices.js

@@ -19,6 +19,13 @@ import Token from '@ckeditor/ckeditor-cloud-services-core/src/token/token';
  */
 export default class CloudServices extends Plugin {
 	/**
+	 * @inheritdoc
+	 */
+	static get pluginName() {
+		return 'CloudServices';
+	}
+
+	/**
 	 * @inheritDoc
 	 */
 	init() {

+ 11 - 0
packages/ckeditor5-cloud-services/tests/cloudservices.js

@@ -46,6 +46,17 @@ describe( 'CloudServices', () => {
 				} );
 		} );
 
+		it( 'should be able to get by its plugin name', () => {
+			return ClassicTestEditor
+				.create( element, {
+					plugins: [ CloudServices ]
+				} )
+				.then( editor => {
+					const cloudServicesPlugin = editor.plugins.get( 'CloudServices' );
+					expect( cloudServicesPlugin ).to.be.instanceOf( CloudServices );
+				} );
+		} );
+
 		it( 'should not throw an error when no config is provided', () => {
 			return ClassicTestEditor
 				.create( element, {