Sfoglia il codice sorgente

Add manual tests for table styles.

Maciej Gołaszewski 6 anni fa
parent
commit
acb229e808

+ 31 - 0
packages/ckeditor5-table/tests/manual/tablestyles.html

@@ -0,0 +1,31 @@
+<div id="editor">
+	<figure>
+		<table style="border: 1px solid green;">
+			<thead>
+				<tr>
+					<td><p>Column A</p></td>
+					<td style="background-color: lightblue"><p>Column B</p></td>
+					<td style="background: palevioletred"><p>Column C</p></td>
+				</tr>
+			</thead>
+			<tbody>
+				<tr>
+					<td style="border-color: deeppink deepskyblue;border-style: solid;border-width: 1px;border-bottom-width: 2px;border-right-style: dotted;">
+						<p>A1</p>
+					</td>
+					<td style="border: 1px solid blue;"><p>B1</p></td>
+					<td style="border: 1px solid red;"><p>C1</p></td>
+				</tr>
+				<tr>
+					<td style="border-right:1px solid blue;"><p>A2</p></td>
+					<td><p>B2</p></td>
+					<td><p>C3</p></td>
+				</tr>
+			</tbody>
+		</table>
+	</figure>
+</div>
+
+<h2>Original editor source</h2>
+
+<div id="cloned-source"></div>

+ 33 - 0
packages/ckeditor5-table/tests/manual/tablestyles.js

@@ -0,0 +1,33 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
+import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
+
+const sourceElement = document.querySelector( '#editor' );
+const clonedSource = sourceElement.cloneNode( true );
+
+document.querySelector( '#cloned-source' ).append( ...clonedSource.childNodes );
+
+ClassicEditor
+	.create( sourceElement, {
+		plugins: [ ArticlePluginSet ],
+		toolbar: [
+			'heading', '|', 'insertTable', '|', 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo'
+		],
+		table: {
+			contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ],
+			tableToolbar: [ 'bold', 'italic' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
+

+ 2 - 0
packages/ckeditor5-table/tests/manual/tablestyles.md

@@ -0,0 +1,2 @@
+### Loading
+