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

Imroved manual test for filtering nodes.

Oskar Wróbel 8 лет назад
Родитель
Сommit
eb1abb654e

+ 7 - 2
packages/ckeditor5-engine/tests/manual/tickets/1088/1.html

@@ -1,6 +1,6 @@
 <div style="padding: 20px;">
 	<div id="editor">
-		<h2>Heading 1 (disallowed: link)</h2>
+		<h2>Heading 1 (disallowed: italic, link)</h2>
 		<p>This is a paragraph</p>
 		<h3>Heading 2 (disallowed: italic)</h3>
 		<p></p>
@@ -8,7 +8,6 @@
 			<p>This is a paragraph in a blockQuote</p>
 			<p></p>
 		</blockquote>
-		<h4>Heading 3 (disallowed: italic, link)</h4>
 	</div>
 
 	<div>
@@ -18,6 +17,12 @@
 			<li><a href="https://ckeditor.com"><b>List item with link and bold</b></a></li>
 		</ul>
 
+		<h4><b>Heading 3 with bold</b></h4>
+
 		<div><b>Just a text with bold</b></div>
+
+		<br>
+
+		<img src="sample.jpg" alt="Sample image" height="150">
 	</div>
 </div>

+ 9 - 6
packages/ckeditor5-engine/tests/manual/tickets/1088/1.js

@@ -6,23 +6,26 @@
 /* globals console, window, document */
 
 import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
-import ArticlePreset from '@ckeditor/ckeditor5-presets/src/article';
+import ArticlePresets from '@ckeditor/ckeditor5-presets/src/article';
 
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
-		plugins: [ ArticlePreset ],
-		toolbar: [ 'headings', 'undo', 'redo' ]
+		plugins: [ ArticlePresets ],
+		toolbar: [ 'headings', 'undo', 'redo' ],
+		image: {
+			toolbar: [ 'imageTextAlternative' ]
+		}
 	} )
 	.then( editor => {
 		window.editor = editor;
 
 		const schema = editor.document.schema;
 
-		schema.disallow( { name: '$text', attributes: [ 'linkHref' ], inside: 'heading1' } );
+		schema.disallow( { name: '$text', attributes: [ 'linkHref', 'italic' ], inside: 'heading1' } );
 		schema.disallow( { name: '$text', attributes: [ 'italic' ], inside: 'heading2' } );
-		schema.disallow( { name: '$text', attributes: [ 'italic', 'linkHref' ], inside: 'heading3' } );
+		schema.disallow( { name: '$text', attributes: [ 'linkHref' ], inside: 'blockQuote listItem' } );
 		schema.disallow( { name: '$text', attributes: [ 'bold' ], inside: 'paragraph' } );
-		schema.disallow( { name: '$text', attributes: [ 'bold', 'linkHref' ], inside: 'blockQuote listItem' } );
+		schema.disallow( { name: 'heading3', inside: '$root' } );
 	} )
 	.catch( err => {
 		console.error( err.stack );

+ 15 - 5
packages/ckeditor5-engine/tests/manual/tickets/1088/1.md

@@ -3,18 +3,28 @@
 ### Simple scenario.
 
 1. Copy a paragraph with italic and link.
-2. Paste it to the Heading 1. Inserted text should have only an italic style.
-3. Paste it to the Heading 2. Inserted text should have only a link.
-4. Paste it to the Heading 3. Inserted text should be fully stripped.
+2. Paste it to the Heading 1. Inserted text should be not stripped.
+3. Paste it to the Heading 2. Inserted text should be a link only.
+
+### Simple scenario (element).
+
+1. Copy image.
+2. Paste it to the editor. Image should be inserted with an alternative text "Sample image".
 
 ### Nested nodes.
 
 1. Copy a list item with bold and link.
-2. Paste it into the empty block (just under the Heading 2). Inserted list item should have a bold style a link.
-2. Paste it into the empty block in BlockQuote. Inserted list item should be fully stripped.
+2. Paste it into the empty block (directly to the root) . Inserted list item should be a bold link.
+2. Paste it into the empty block in BlockQuote. Inserted list item should be a bold only.
 
 ### Auto paragraphing.
 
 1. Copy a text with bold.
 2. Select all content in the editor.
 3. Paste copied text. Inserted content should be a paragraph and should be stripped from bold.
+
+### Auto paragraphing (disallowed block).
+
+1. Copy Heading 3 with bold
+2. Select all content in the editor.
+3. Paste copied text. Inserted content should be a paragraph and should be stripped from bold.

BIN
packages/ckeditor5-engine/tests/manual/tickets/1088/sample.jpg