integration.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. const browsers = [ 'chrome', 'firefox', 'safari', 'edge' ];
  24. describe( 'PasteFromOffice - integration', () => {
  25. generateTests( {
  26. input: 'basic-styles',
  27. type: 'integration',
  28. browsers,
  29. editorConfig: {
  30. plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Strikethrough, PasteFromOffice ]
  31. },
  32. skip: {
  33. safari: [ 'italicStartingText', 'multipleStylesSingleLine', 'multipleStylesMultiline' ] // Skip due to spacing issue (#13).
  34. }
  35. } );
  36. generateTests( {
  37. input: 'image',
  38. type: 'integration',
  39. browsers,
  40. editorConfig: {
  41. plugins: [ Clipboard, Paragraph, Image, Table, PasteFromOffice ]
  42. },
  43. skip: {
  44. chrome: [],
  45. firefox: [],
  46. safari: [],
  47. edge: [ 'adjacentGroups' ]
  48. }
  49. } );
  50. generateTests( {
  51. input: 'link',
  52. type: 'integration',
  53. browsers,
  54. editorConfig: {
  55. plugins: [ Clipboard, Paragraph, Heading, Bold, Link, ShiftEnter, PasteFromOffice ]
  56. },
  57. skip: {
  58. safari: [ 'combined' ] // Skip due to spacing issue (#13).
  59. }
  60. } );
  61. generateTests( {
  62. input: 'list',
  63. type: 'integration',
  64. browsers,
  65. editorConfig: {
  66. plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Link, List, PasteFromOffice ]
  67. },
  68. skip: {
  69. safari: [ 'heading3Styled' ] // Skip due to spacing issue (#13).
  70. }
  71. } );
  72. generateTests( {
  73. input: 'spacing',
  74. type: 'integration',
  75. browsers,
  76. editorConfig: {
  77. plugins: [ Clipboard, Paragraph, Bold, Italic, Underline, PasteFromOffice ]
  78. }
  79. } );
  80. generateTests( {
  81. input: 'google-docs-bold-wrapper',
  82. type: 'integration',
  83. browsers,
  84. editorConfig: {
  85. plugins: [ Clipboard, Paragraph, Bold, PasteFromOffice ]
  86. }
  87. } );
  88. generateTests( {
  89. input: 'google-docs-list',
  90. type: 'integration',
  91. browsers,
  92. editorConfig: {
  93. plugins: [ Clipboard, Paragraph, List, PasteFromOffice ]
  94. }
  95. } );
  96. generateTests( {
  97. input: 'generic-list-in-table',
  98. type: 'integration',
  99. browsers,
  100. editorConfig: {
  101. plugins: [ Clipboard, Paragraph, List, Table, Bold, PasteFromOffice ]
  102. }
  103. } );
  104. generateTests( {
  105. input: 'table',
  106. type: 'integration',
  107. browsers,
  108. editorConfig: {
  109. plugins: [ Clipboard, Paragraph, Table, TableProperties, TableCellProperties, Bold, PasteFromOffice,
  110. FontColor, FontBackgroundColor ]
  111. }
  112. } );
  113. } );