Browse Source

Update manual test description ad functions.

Mateusz Samsel 6 years ago
parent
commit
fbf305edf9

+ 2 - 1
packages/ckeditor5-word-count/tests/manual/wordcount.html

@@ -4,8 +4,9 @@
 	}
 </style>
 <h2>Test editor</h2>
+<button id="destroy-editor">Destroy editor</button>
 <div id="editor">
-	Hello world
+	Hello world.
 </div>
 <div id="words">
 </div>

+ 4 - 0
packages/ckeditor5-word-count/tests/manual/wordcount.js

@@ -27,6 +27,10 @@ ClassicEditor
 		} );
 
 		document.getElementById( 'words' ).appendChild( wordCount );
+
+		document.getElementById( 'destroy-editor' ).addEventListener( 'click', () => {
+			editor.destroy();
+		} );
 	} )
 	.catch( err => {
 		console.error( err.stack );

+ 8 - 1
packages/ckeditor5-word-count/tests/manual/wordcount.md

@@ -1 +1,8 @@
-Test it
+1. Try to type in editor. Container below should be automatically updated with new amount of words and characters.
+2. Special characters are treat as separators for words. For example
+	* `Hello world` - 2 words
+	* `Hello(World)` - 2 words
+	* `Hello\nWorld` - 2 words
+3. Numbers are treat as words.
+4. There are logged values of `WordCount:event-update` in the console. Values should change in same way as container in html.
+5. After destroy container with word and character values should be removed.