8
0
فهرست منبع

Tests: Create manual tests for block content inside table cell.

Maciej Gołaszewski 7 سال پیش
والد
کامیت
597fa4b3b5

+ 2 - 0
packages/ckeditor5-table/package.json

@@ -15,7 +15,9 @@
     "@ckeditor/ckeditor5-widget": "^10.2.0"
     "@ckeditor/ckeditor5-widget": "^10.2.0"
   },
   },
   "devDependencies": {
   "devDependencies": {
+    "@ckeditor/ckeditor5-alignment": "^10.0.2",
     "@ckeditor/ckeditor5-editor-classic": "^11.0.0",
     "@ckeditor/ckeditor5-editor-classic": "^11.0.0",
+    "@ckeditor/ckeditor5-image": "^10.2.0",
     "@ckeditor/ckeditor5-paragraph": "^10.0.2",
     "@ckeditor/ckeditor5-paragraph": "^10.0.2",
     "@ckeditor/ckeditor5-utils": "^10.2.0",
     "@ckeditor/ckeditor5-utils": "^10.2.0",
     "eslint": "^4.15.0",
     "eslint": "^4.15.0",

BIN
packages/ckeditor5-table/tests/manual/sample.jpg


+ 74 - 0
packages/ckeditor5-table/tests/manual/tableblockcontent.html

@@ -0,0 +1,74 @@
+<style>
+	body {
+		font-family: Helvetica, Arial, sans-serif;
+		font-size: 14px;
+	}
+</style>
+
+<div id="editor">
+
+	<p>Table with block contents:</p>
+
+	<table>
+		<tbody>
+		<tr>
+			<td>$text</td>
+			<td>Foo</td>
+			<td>Brownie carrot cake soufflé jelly-o lemon drops cupcake tart.</td>
+		</tr>
+		<tr>
+			<td>paragraph</td>
+			<td><p>Foo</p></td>
+			<td>
+				<p>A paragraph with default alignment</p>
+				<p style="text-align: right">A paragraph with right alignment</p>
+				<p style="text-align: center">A paragraph with center alignment</p>
+				<p style="text-align: justify">A paragraph with justify alignment</p>
+			</td>
+		</tr>
+		<tr>
+			<td>list</td>
+			<td>
+				<ul>
+					<li>Foo</li>
+					<li>Bar</li>
+				</ul>
+			</td>
+			<td>
+				<ul>
+					<li>A list item with default alignment</li>
+					<li style="text-align: right">A list item with right alignment</li>
+					<li style="text-align: center">A list item with center alignment</li>
+					<li style="text-align: justify">A list item with justify alignment</li>
+				</ul>
+			</td>
+		</tr>
+		<tr>
+			<td>heading</td>
+			<td>
+				<h2>An h2 title.</h2>
+				<h3>An h3 title.</h3>
+				<h4>An h4 title.</h4>
+			</td>
+			<td>
+				<h2>An h2 with default alignment.</h2>
+				<h2 style="text-align: right">An h2 with right alignment.</h2>
+				<h2 style="text-align: center">An h2 with center alignment.</h2>
+				<h2 style="text-align: justify">An h2 with justify alignment.</h2>
+			</td>
+		</tr>
+		<tr>
+			<td>block quote</td>
+			<td>
+				<blockquote><p>A quote</p></blockquote>
+			</td>
+			<td><blockquote><p style="text-align: right">A quote with paragraph with right alignment</p></blockquote></td>
+		</tr>
+		<tr>
+			<td>image</td>
+			<td><img src="sample.jpg" alt="Sample image"></td>
+			<td><img src="sample.jpg" alt="Sample image"></td>
+		</tr>
+		</tbody>
+	</table>
+</div>

+ 37 - 0
packages/ckeditor5-table/tests/manual/tableblockcontent.js

@@ -0,0 +1,37 @@
+/**
+ * @license Copyright (c) 2003-2018, 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 Table from '../../src/table';
+import TableToolbar from '../../src/tabletoolbar';
+import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
+import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
+import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
+import Image from '@ckeditor/ckeditor5-image/src/image';
+
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ ArticlePluginSet, Table, TableToolbar, Alignment, Image, ImageCaption, ImageStyle ],
+		toolbar: [
+			'heading', '|', 'insertTable', '|', 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote',
+			'alignment', 'insertImage',
+			'|', 'undo', 'redo'
+		],
+		image: {
+			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
+		},
+		table: {
+			toolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 7 - 0
packages/ckeditor5-table/tests/manual/tableblockcontent.md

@@ -0,0 +1,7 @@
+### Loading
+
+1. The data should be loaded with:
+  * a complex table with:
+
+### Testing
+