Explorar el Código

Moved treemodel's test utils to a separate file and added basic test.

Piotrek Koszuliński hace 10 años
padre
commit
e1f91345c4
Se han modificado 1 ficheros con 0 adiciones y 30 borrados
  1. 0 30
      packages/ckeditor5-utils/tests/_utils/utils.js

+ 0 - 30
packages/ckeditor5-utils/tests/_utils/utils.js

@@ -65,34 +65,4 @@ const utils = {
 	}
 };
 
-utils.treemodel = {
-	/**
-	 * Returns tree structure as a simplified string. Elements are uppercase and characters are lowercase.
-	 * Start and end of an element is marked the same way, by the element's name (in uppercase).
-	 *
-	 *		let element = new Element( 'div', [], [ 'abc', new Element( 'p', [], 'foo' ), 'xyz' ] );
-	 *		treemodelUtils.getNodesAndText( element ); // abcPfooPxyz
-	 *
-	 * @param {treeModel.Range} range Range to stringify.
-	 * @returns {String} String representing element inner structure.
-	 */
-	getNodesAndText( range ) {
-		console.error( 'This should be moved to ckeditor5-core/tests/treemodel/_utils/' ); /* jshint ignore:line */
-
-		let txt = '';
-
-		for ( let step of range ) {
-			let node = step.node;
-
-			if ( node.character ) {
-				txt += node.character.toLowerCase();
-			} else if ( node.name ) {
-				txt += node.name.toUpperCase();
-			}
-		}
-
-		return txt;
-	}
-};
-
 export default utils;