Browse Source

Updated test to include fontColor and fontBackgroundColor.

Kuba Niegowski 5 years ago
parent
commit
6e76383226

+ 2 - 1
packages/ckeditor5-paste-from-office/tests/_data/table/tablecellproperties/input.html

@@ -793,7 +793,8 @@ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
 mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
 mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
 			<p class=MsoNormal align=center style='text-align:center'><span lang=EN-US
-																			style='mso-bidi-font-family:Arial'>2019-10-15<o:p></o:p></span></p>
+																			style='mso-bidi-font-family:Arial;background:red;mso-highlight:red'>2019-10-15</span><span
+					lang=EN-US style='mso-bidi-font-family:Arial'><o:p></o:p></span></p>
 		</td>
 		<td width="17%" style='width:17.0%;border-top:none;border-left:none;
 border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;

+ 4 - 4
packages/ckeditor5-paste-from-office/tests/_data/table/tablecellproperties/model.html

@@ -15,10 +15,10 @@
 			<paragraph>Phase 1: Market research</paragraph>
 		</tableCell>
 		<tableCell borderColor="{"bottom":"windowtext","right":"windowtext"}" borderStyle="{"top":"none","left":"none","bottom":"solid","right":"solid"}" borderWidth="{"bottom":"1.0pt","right":"1.0pt"}" padding="{"top":"0cm","bottom":"0cm","right":"5.4pt","left":"5.4pt"}" width="24.0%">
-			<paragraph>2019-10-15</paragraph>
+			<paragraph><$text fontBackgroundColor="red">2019-10-15</$text></paragraph>
 		</tableCell>
 		<tableCell borderColor="{"bottom":"windowtext","right":"windowtext"}" borderStyle="{"top":"none","left":"none","bottom":"solid","right":"solid"}" borderWidth="{"bottom":"1.0pt","right":"1.0pt"}" padding="{"top":"0cm","bottom":"0cm","right":"5.4pt","left":"5.4pt"}" width="17.0%">
-			<paragraph>✓</paragraph>
+			<paragraph><$text fontColor="#00B050"></$text></paragraph>
 		</tableCell>
 		</tableRow>
 	<tableRow>
@@ -29,7 +29,7 @@
 			<paragraph>2019-10-20</paragraph>
 		</tableCell>
 		<tableCell backgroundColor="#EEEEEE" borderColor="{"bottom":"windowtext","right":"windowtext"}" borderStyle="{"top":"none","left":"none","bottom":"solid","right":"solid"}" borderWidth="{"bottom":"1.0pt","right":"1.0pt"}" padding="{"top":"0cm","bottom":"0cm","right":"5.4pt","left":"5.4pt"}" width="17.0%">
-			<paragraph>✓</paragraph>
+			<paragraph><$text fontColor="#00B050"></$text></paragraph>
 		</tableCell>
 	</tableRow>
 	<tableRow>
@@ -40,7 +40,7 @@
 			<paragraph>2019-10-22</paragraph>
 		</tableCell>
 		<tableCell borderColor="{"bottom":"windowtext","right":"windowtext"}" borderStyle="{"top":"none","left":"none","bottom":"solid","right":"solid"}" borderWidth="{"bottom":"1.0pt","right":"1.0pt"}" padding="{"top":"0cm","bottom":"0cm","right":"5.4pt","left":"5.4pt"}" width="17.0%">
-			<paragraph>✓</paragraph>
+			<paragraph><$text fontColor="#00B050"></$text></paragraph>
 		</tableCell>
 	</tableRow>
 </table>

BIN
packages/ckeditor5-paste-from-office/tests/_data/table/tablecellproperties/tablecellproperties.docx


+ 4 - 1
packages/ckeditor5-paste-from-office/tests/data/integration.js

@@ -17,6 +17,8 @@ import Image from '@ckeditor/ckeditor5-image/src/image';
 import Table from '@ckeditor/ckeditor5-table/src/table';
 import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
 import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
+import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor';
+import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor';
 
 import PasteFromOffice from '../../src/pastefromoffice';
 import { generateTests } from '../_utils/utils';
@@ -116,7 +118,8 @@ describe( 'PasteFromOffice - integration', () => {
 		type: 'integration',
 		browsers,
 		editorConfig: {
-			plugins: [ Clipboard, Paragraph, Table, TableProperties, TableCellProperties, Bold, PasteFromOffice ]
+			plugins: [ Clipboard, Paragraph, Table, TableProperties, TableCellProperties, Bold, PasteFromOffice,
+				FontColor, FontBackgroundColor ]
 		}
 	} );
 } );

+ 6 - 3
packages/ckeditor5-paste-from-office/tests/manual/integration.js

@@ -13,13 +13,16 @@ import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
 import Table from '@ckeditor/ckeditor5-table/src/table';
 import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar';
 import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
+import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor';
+import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor';
+import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
+import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
+
 import PasteFromOffice from '../../src/pastefromoffice';
 
 import { stringify as stringifyView } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
 
 import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
-import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
-import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
 
 const htmlDiv = document.querySelector( '#html' );
 const textDiv = document.querySelector( '#text' );
@@ -28,7 +31,7 @@ const dataDiv = document.querySelector( '#data' );
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ ArticlePluginSet, Strikethrough, Underline, Table, TableToolbar,
-			TableProperties, TableCellProperties, EasyImage, PasteFromOffice ],
+			TableProperties, TableCellProperties, EasyImage, PasteFromOffice, FontColor, FontBackgroundColor ],
 		toolbar: [ 'heading', '|', 'bold', 'italic', 'strikethrough', 'underline', 'link',
 			'bulletedList', 'numberedList', 'blockQuote', 'insertTable', 'undo', 'redo' ],
 		table: {