8
0
فهرست منبع

Stub text transformation feature.

Maciej Gołaszewski 6 سال پیش
والد
کامیت
9224b754b6
2فایلهای تغییر یافته به همراه61 افزوده شده و 0 حذف شده
  1. 26 0
      packages/ckeditor5-typing/src/texttransformation.js
  2. 35 0
      packages/ckeditor5-typing/tests/texttransformation.js

+ 26 - 0
packages/ckeditor5-typing/src/texttransformation.js

@@ -0,0 +1,26 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+/**
+ * @module text-transformation/texttransformation
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+/**
+ * The text transformation plugin.
+ *
+ * For a detailed overview, check the {@glink features/text-transformation Text transformation feature documentation}.
+ *
+ * @extends module:core/plugin~Plugin
+ */
+export default class TextTransformation extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'TextTransformation';
+	}
+}

+ 35 - 0
packages/ckeditor5-typing/tests/texttransformation.js

@@ -0,0 +1,35 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
+import global from '@ckeditor/ckeditor5-utils/src/dom/global';
+
+import TextTransformation from '../src/texttransformation';
+
+describe( 'Text transformation feature', () => {
+	let editorElement, editor;
+
+	beforeEach( () => {
+		editorElement = global.document.createElement( 'div' );
+		global.document.body.appendChild( editorElement );
+
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ TextTransformation ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
+	} );
+
+	it( 'should be loaded', () => {
+		expect( editor.plugins.get( TextTransformation ) ).to.instanceOf( TextTransformation );
+	} );
+
+	it( 'has proper name', () => {
+		expect( TextTransformation.pluginName ).to.equal( 'TextTransformation' );
+	} );
+} );
+