瀏覽代碼

Add additional configuration tests

panr 5 年之前
父節點
當前提交
f84cb90404
共有 1 個文件被更改,包括 32 次插入0 次删除
  1. 32 0
      packages/ckeditor5-typing/tests/texttransformation.js

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

@@ -216,6 +216,38 @@ describe( 'Text transformation feature', () => {
 	} );
 
 	describe( 'configuration', () => {
+		it( 'should contain only one #configuredTransformations', () => {
+			return createEditorInstance( {
+				typing: {
+					transformations: {
+						include: [
+							{ from: 'CKE', to: 'CKEditor' }
+						]
+					}
+				}
+			} ).then( () => {
+				const plugin = editor.plugins.get( 'TextTransformation' );
+
+				expect( plugin.configuredTransformations.length ).to.be.equal( 1 );
+			} );
+		} );
+
+		it( 'should contain only one #_normalizedConfiguredTransformations', () => {
+			return createEditorInstance( {
+				typing: {
+					transformations: {
+						include: [
+							{ from: 'CKE', to: 'CKEditor' }
+						]
+					}
+				}
+			} ).then( () => {
+				const plugin = editor.plugins.get( 'TextTransformation' );
+
+				expect( plugin._normalizedConfiguredTransformations.size ).to.be.equal( 1 );
+			} );
+		} );
+
 		it( 'should allow adding own rules with string pattern', () => {
 			return createEditorInstance( {
 				typing: {