8
0
Просмотр исходного кода

Tests: improved the manual test.

Piotrek Koszuliński 9 лет назад
Родитель
Сommit
431ba88081

+ 0 - 1
packages/ckeditor5-engine/tests/tickets/462/1.html

@@ -1,5 +1,4 @@
 <head>
-	<meta charset="utf-8">
 	<link rel="stylesheet" href="%APPS_DIR%ckeditor/build/modules/amd/theme/ckeditor.css">
 </head>
 

+ 10 - 1
packages/ckeditor5-engine/tests/tickets/462/1.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  */
 
-/* globals console:false, window, document */
+/* globals console, window, document, setInterval */
 
 import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
 
@@ -13,6 +13,15 @@ ClassicEditor.create( document.querySelector( '#editor' ), {
 } )
 .then( editor => {
 	window.editor = editor;
+
+	setInterval( () => {
+		console.clear();
+
+		console.log( editor.editing.view.getDomRoot().innerHTML.replace( /\u200b/g, '@' ) );
+		console.log( 'selection.hasAttribute( italic )', editor.document.selection.hasAttribute( 'italic' ) );
+		console.log( 'selection.hasAttribute( bold )', editor.document.selection.hasAttribute( 'bold' ) );
+		console.log( 'selection anchor\'s parentNode', document.getSelection().anchorNode.parentNode );
+	}, 2000 );
 } )
 .catch( err => {
 	console.error( err.stack );

+ 10 - 17
packages/ckeditor5-engine/tests/tickets/462/1.md

@@ -1,34 +1,27 @@
 @bender-ui: collapsed
-@bender-tags: ticket, 462, 0.4.0, iteration4
+@bender-tags: ticket, 462, iteration4
 
 ### Selection attributes conversion test [#462](https://github.com/ckeditor/ckeditor5-engine/issues/462)
 
-Open console and inspect a paragraph in editable. Remember to not blur editor after setting selection.
-
 #### Test 1
 
 1. Put caret inside unstyled word.
-2. Press italic key in toolbar.
+2. Press <kbd>Ctrl+I</kbd>.
 
 Expected results:
 
-`<em></em>` was inserted into editable (along with filler characters).
-
-`editor.document.selection.hasAttribute( 'italic' )` returns `true`.
-
-`document.getSelection().anchorNode.parentNode` returns `<em>` element.
+* `<em>@@@@@@@</em>` was inserted into editable.
+* selection has the `'italic'` attribute.
+* selection anchor's parent node is `<em>`.
 
 #### Test 2
 
 1. Put caret inside bold word.
-2. Press bold key in toolbar.
+2. Press <kbd>Ctrl+B</kbd>.
 
 Expected results:
 
-`<strong>` element from previous test got removed.
-
-`<strong>` element got broken.
-
-`editor.document.selection.hasAttribute( 'bold' )` returns `false`.
-
-`document.getSelection().anchorNode` returns `<p>` element.
+* `<em>` element from previous test got removed.
+* `<strong>` element got broken.
+* selection doesn't have the `'bold'` attribute.
+* selection anchor's parent node is `<p>`.