Sfoglia il codice sorgente

Tests: Add manual tests.

Maciej Gołaszewski 8 anni fa
parent
commit
94c9153f75

+ 28 - 1
packages/ckeditor5-alignment/tests/manual/alignment.md

@@ -1,6 +1,33 @@
 ### Loading
 
-TODO:
+1. The data should be loaded with:
+  * first paragraph with default (left) alignment,
+  * second paragraph aligned to right,
+  * third paragraph should be centered,
+  * fourth paragraph should be justified,
+  * an image with caption between first and second paragraphs.
+2. Toolbar should have four buttons for alignment control: left, right, center and justify.
 
 ### Testing
 
+You should be able to:
+1. Change alignment on any paragraph.
+2. Change alignment on any selection of paragraphs.
+
+You should not be able to change alignment of figcaption by:
+1. Placing cursor inside caption.
+2. Selecting image with other paragraphs.
+
+You should be able to create blocks that can be aligned:
+1. paragraphs
+2. headings
+3. lists
+
+Alignment UI should:
+1. highlight "left" button when selection is inside left aligned block (default one)
+2. highlight "right" button when selection is inside right aligned block
+3. highlight "center" button when selection is inside centered block
+4. highlight "justify" button when selection is inside justified block
+5. be disabled if in figcaption
+6. only one button should be active at once
+

+ 12 - 0
packages/ckeditor5-alignment/tests/manual/alignmentconfig.html

@@ -0,0 +1,12 @@
+<div id="editor">
+	<p style="text-align:left"><strong>This paragraph has text-align:left style</strong></p>
+
+	<p style="text-align:right"><strong>This paragraph has text-align:right style</strong></p>
+
+	<p style="text-align:center"><strong>This paragraph has text-align:center style</strong></p>
+
+	<p style="text-align:justify"><strong>This paragraph has text-align:justify style</strong>. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
+		eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
+		ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+		pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+</div>

+ 26 - 0
packages/ckeditor5-alignment/tests/manual/alignmentconfig.js

@@ -0,0 +1,26 @@
+/**
+ * @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/classiceditor';
+import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
+import Alignment from '../../src/alignment';
+
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ ArticlePluginSet, Alignment ],
+		toolbar: [
+			'headings', 'bold', 'italic', 'link', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'bulletedList', 'numberedList',
+			'blockQuote', 'undo', 'redo'
+		],
+		alignment: { styles: [ 'center', 'justify' ] }
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 19 - 0
packages/ckeditor5-alignment/tests/manual/alignmentconfig.md

@@ -0,0 +1,19 @@
+### Loading
+
+1. The data should be loaded with:
+  * four paragraphs each with different text-alignemnt set,
+  * two first paragraphs should be aligned to left,
+  * third paragraph should be centered,
+  * fourth paragraph should be justified,
+  * an image with caption between first and second paragraphs.
+2. Toolbar should have only two buttons for alignment control: center and justify.
+
+### Testing
+
+"Center" alignment button:
+1. should be highlighted only in third paragraph,
+2. should enable/disable center alignment on any paragraph.
+
+"Justify" alignment button should be:
+1. highlighted only in third paragraph,
+2. should enable/disable justify alignment on any paragraph.