8
0

integration.js 4.0 KB

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