ソースを参照

Tests: updated description of manual test for flat lists. Added manual test for nested lists.

Szymon Cofalik 8 年 前
コミット
8b9e309c8c

+ 42 - 37
packages/ckeditor5-list/tests/manual/list.md

@@ -2,47 +2,52 @@
 
 1. The data should be loaded with:
   * two paragraphs,
-  * bulleted list with four items,
+  * bulleted list with eight items,
   * two paragraphs,
-  * numbered list with an item,
-  * bullet list with an item.
+  * numbered list with one item,
+  * bullet list with one item.
 2. Toolbar should have two buttons: for bullet and for numbered list.
 
 ### Testing
 
 After each step test undo (whole stack) -> redo (whole stack) -> undo (whole stack).
 
-1. Creating:
-  1. Convert first paragraph to list item
-  2. Create empty paragraph and convert to list item
-  3. Enter in the middle of item
-  4. Enter at the start of item
-  5. Enter at the end of item
-
-2. Removing:
-  1. Delete all contents from list item and then the list item
-  2. Press enter in empty list item
-  3. Click on highlighted button ("turn off" list feature)
-  4. Do it for first, second and last list item
-
-3. Changing type:
-  1. Change type from bulleted to numbered
-  2. Do it for first, second and last item
-  3. Do it for multiple items at once
-
-4. Merging:
-  1. Convert paragraph before list to same type of list
-  2. Convert paragraph after list to same type of list
-  3. Convert paragraph before list to different type of list
-  4. Convert paragraph after list to different type of list
-  5. Convert first paragraph to bulleted list, then convert second paragraph to bulleted list
-  6. Convert multiple items and paragraphs at once
-
-5. Selection deletion. Make selection between items and press delete button:
-  1. two items from the same list
-  2. all items in a list
-  3. paragraph before list and second item of list
-  4. paragraph after list and one-but-last item of list
-  5. two paragraphs that have list between them
-  6. two items from different lists of same type
-  7. two items from different lists of different type
+Creating:
+
+1. Convert first paragraph to list item
+2. Create empty paragraph and convert to list item
+3. Enter in the middle of item
+4. Enter at the start of item
+5. Enter at the end of item
+
+Removing:
+
+1. Delete all contents from list item and then the list item
+2. Press enter in empty list item
+3. Click on highlighted button ("turn off" list feature)
+4. Do it for first, second and last list item
+
+Changing type:
+
+1. Change type from bulleted to numbered
+2. Do it for first, second and last item
+3. Do it for multiple items at once
+
+Merging:
+
+1. Convert paragraph before list to same type of list
+2. Convert paragraph after list to same type of list
+3. Convert paragraph before list to different type of list
+4. Convert paragraph after list to different type of list
+5. Convert first paragraph to bulleted list, then convert second paragraph to bulleted list
+6. Convert multiple items and paragraphs at once
+
+Selection deletion. Make selection between items and press delete button:
+
+1. two items from the same list
+2. all items in a list
+3. paragraph before list and second item of list
+4. paragraph after list and one-but-last item of list
+5. two paragraphs that have list between them
+6. two items from different lists of same type
+7. two items from different lists of different type

+ 36 - 0
packages/ckeditor5-list/tests/manual/nestedlists.html

@@ -0,0 +1,36 @@
+<div id="editor">
+	<ul>
+		<li>
+			Bullet list item 1
+			<ul>
+				<li>
+					Bullet list item 1.1
+					<ul>
+						<li>Bullet list item 1.1.1</li>
+					</ul>
+				</li>
+				<li>
+					Bullet list item 1.2
+					<ul>
+						<li>Bullet list item 1.2.1</li>
+						<li>Bullet list item 1.2.2</li>
+					</ul>
+					<ol>
+						<li>Numbered list item 1.2.3</li>
+						<li>Numbered list item 1.2.4</li>
+					</ol>
+				</li>
+			</ul>
+		</li>
+		<li>
+			<ul>
+				<li>
+					<ol>
+						<li>Numbered list item 2.1.1</li>
+						<li>Numbered list item 2.1.2</li>
+					</ol>
+				</li>
+			</ul>
+		</li>
+	</ul>
+</div>

+ 27 - 0
packages/ckeditor5-list/tests/manual/nestedlists.js

@@ -0,0 +1,27 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classic';
+import Enter from '@ckeditor/ckeditor5-enter/src/enter';
+import Typing from '@ckeditor/ckeditor5-typing/src/typing';
+import Heading from '@ckeditor/ckeditor5-heading/src/heading';
+import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
+import Undo from '@ckeditor/ckeditor5-undo/src/undo';
+import List from '../../src/list';
+
+ClassicEditor.create( document.querySelector( '#editor' ), {
+	plugins: [ Enter, Typing, Heading, Paragraph, Undo, List ],
+	toolbar: [ 'headings', 'bulletedList', 'numberedList', 'undo', 'redo' ]
+} )
+.then( editor => {
+	window.editor = editor;
+	window.modelRoot = editor.document.getRoot();
+	window.viewRoot = editor.editing.view.getRoot();
+} )
+.catch( err => {
+	console.error( err.stack );
+} );

+ 61 - 0
packages/ckeditor5-list/tests/manual/nestedlists.md

@@ -0,0 +1,61 @@
+### Loading
+
+The loaded data should look like this:
+
+<ul>
+	<li>
+		Bullet list item 1
+		<ul>
+			<li>
+				Bullet list item 1.1
+				<ul>
+					<li>Bullet list item 1.1.1</li>
+				</ul>
+			</li>
+			<li>
+				Bullet list item 1.2
+				<ul>
+					<li>Bullet list item 1.2.1</li>
+					<li>Bullet list item 1.2.2</li>
+				</ul>
+				<ol>
+					<li>Numbered list item 1.2.3</li>
+					<li>Numbered list item 1.2.4</li>
+				</ol>
+			</li>
+		</ul>
+	</li>
+	<li>
+		&nbsp;
+		<ul>
+			<li>
+				&nbsp;
+				<ol>
+					<li>Numbered list item 2.1.1</li>
+					<li>Numbered list item 2.1.2</li>
+				</ol>
+			</li>
+		</ul>
+	</li>
+</ul>
+
+### Testing
+
+Check if:
+
+1. You can write and delete in indented list items and remove indented list items.
+2. Tab key indents list item (other than first item on the list).
+3. Shift+tab key outdents list item.
+4. Enter key creates list item with same indent.
+5. Enter key in empty list item outdents it.
+6. Indenting and outdenting list item also indents/outdents following items.
+7. Outdenting not-indented item converts it to paragraph.
+8. Enter in not-indented item converts it to paragraph.
+9. Lists are correctly merged after outdenting.
+10. Lists are correctly merged when removing list item from between lists (for example 1.2, 1.1, 2.1 (empty)).
+11. Lists are correctly merged when deleting multi-level selection.
+12. You can put selection in empty list item, write something there, remove it.
+13. Changing list type works correctly with nested lists.
+14. Turning off list item works correctly.
+15. Changing list item to heading works correctly (undo may not work correctly for this one).
+16. Undo works correctly.