Parcourir la source

Add additional configuration tests

panr il y a 5 ans
Parent
commit
f84cb90404
1 fichiers modifiés avec 32 ajouts et 0 suppressions
  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: {