8
0

integration.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard';
  6. import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  7. import ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter';
  8. import Heading from '@ckeditor/ckeditor5-heading/src/heading';
  9. import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  10. import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
  11. import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  12. import Link from '@ckeditor/ckeditor5-link/src/link';
  13. import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
  14. import List from '@ckeditor/ckeditor5-list/src/list';
  15. import ListStyle from '@ckeditor/ckeditor5-list/src/liststyle';
  16. import Image from '@ckeditor/ckeditor5-image/src/image';
  17. import Table from '@ckeditor/ckeditor5-table/src/table';
  18. import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
  19. import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
  20. import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor';
  21. import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor';
  22. import PasteFromOffice from '../../src/pastefromoffice';
  23. import { generateTests } from '../_utils/utils';
  24. import PageBreak from '@ckeditor/ckeditor5-page-break/src/pagebreak';
  25. const browsers = [ 'chrome', 'firefox', 'safari', 'edge' ];
  26. describe( 'PasteFromOffice - integration', () => {
  27. generateTests( {
  28. input: 'basic-styles',
  29. type: 'integration',
  30. browsers,
  31. editorConfig: {
  32. plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Strikethrough, PasteFromOffice ]
  33. },
  34. skip: {
  35. safari: [ 'italicStartingText', 'multipleStylesSingleLine', 'multipleStylesMultiline' ] // Skip due to spacing issue (#13).
  36. }
  37. } );
  38. generateTests( {
  39. input: 'image',
  40. type: 'integration',
  41. browsers,
  42. editorConfig: {
  43. plugins: [ Clipboard, Paragraph, Image, Table, PasteFromOffice ]
  44. },
  45. skip: {
  46. chrome: [],
  47. firefox: [],
  48. safari: [],
  49. edge: [ 'adjacentGroups' ]
  50. }
  51. } );
  52. generateTests( {
  53. input: 'link',
  54. type: 'integration',
  55. browsers,
  56. editorConfig: {
  57. plugins: [ Clipboard, Paragraph, Heading, Bold, Link, ShiftEnter, PasteFromOffice ]
  58. },
  59. skip: {
  60. safari: [ 'combined' ] // Skip due to spacing issue (#13).
  61. }
  62. } );
  63. generateTests( {
  64. input: 'list',
  65. type: 'integration',
  66. browsers,
  67. editorConfig: {
  68. plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Link, List, ListStyle, PasteFromOffice ]
  69. },
  70. skip: {
  71. safari: [ 'heading3Styled' ] // Skip due to spacing issue (#13).
  72. }
  73. } );
  74. generateTests( {
  75. input: 'spacing',
  76. type: 'integration',
  77. browsers,
  78. editorConfig: {
  79. plugins: [ Clipboard, Paragraph, Bold, Italic, Underline, PasteFromOffice ]
  80. }
  81. } );
  82. generateTests( {
  83. input: 'google-docs-bold-wrapper',
  84. type: 'integration',
  85. browsers,
  86. editorConfig: {
  87. plugins: [ Clipboard, Paragraph, Bold, PasteFromOffice ]
  88. }
  89. } );
  90. generateTests( {
  91. input: 'google-docs-list',
  92. type: 'integration',
  93. browsers,
  94. editorConfig: {
  95. plugins: [ Clipboard, Paragraph, List, PasteFromOffice ]
  96. }
  97. } );
  98. generateTests( {
  99. input: 'generic-list-in-table',
  100. type: 'integration',
  101. browsers,
  102. editorConfig: {
  103. plugins: [ Clipboard, Paragraph, List, Table, Bold, PasteFromOffice ]
  104. }
  105. } );
  106. generateTests( {
  107. input: 'table',
  108. type: 'integration',
  109. browsers,
  110. editorConfig: {
  111. plugins: [ Clipboard, Paragraph, Table, TableProperties, TableCellProperties, Bold, PasteFromOffice,
  112. FontColor, FontBackgroundColor ]
  113. }
  114. } );
  115. // See: https://github.com/ckeditor/ckeditor5/issues/7684.
  116. generateTests( {
  117. input: 'font-without-table-properties',
  118. type: 'integration',
  119. browsers,
  120. editorConfig: {
  121. plugins: [ Clipboard, Paragraph, Table, Bold, PasteFromOffice, FontColor, FontBackgroundColor ]
  122. }
  123. } );
  124. generateTests( {
  125. input: 'page-break',
  126. type: 'integration',
  127. browsers,
  128. editorConfig: {
  129. plugins: [ Clipboard, Paragraph, Bold, PasteFromOffice, PageBreak ]
  130. }
  131. } );
  132. } );