integration.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**
  2. * @license Copyright (c) 2003-2019, 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 env from '@ckeditor/ckeditor5-utils/src/env';
  18. import PasteFromOffice from '../../src/pastefromoffice';
  19. import { generateTests } from '../_utils/utils';
  20. const browsers = [ 'chrome', 'firefox', 'safari', 'edge' ];
  21. describe( 'PasteFromOffice - integration', () => {
  22. generateTests( {
  23. input: 'basic-styles',
  24. type: 'integration',
  25. browsers,
  26. editorConfig: {
  27. plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Strikethrough, PasteFromOffice ]
  28. },
  29. skip: {
  30. safari: [ 'italicStartingText', 'multipleStylesSingleLine', 'multipleStylesMultiline' ] // Skip due to spacing issue (#13).
  31. }
  32. } );
  33. generateTests( {
  34. input: 'image',
  35. type: 'integration',
  36. browsers,
  37. editorConfig: {
  38. plugins: [ Clipboard, Paragraph, Image, Table, PasteFromOffice ]
  39. },
  40. skip: {
  41. chrome: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
  42. firefox: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
  43. safari: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
  44. edge: ( env.isEdge ? [] : [ 'adjacentGroups' ] )
  45. }
  46. } );
  47. generateTests( {
  48. input: 'link',
  49. type: 'integration',
  50. browsers,
  51. editorConfig: {
  52. plugins: [ Clipboard, Paragraph, Heading, Bold, Link, ShiftEnter, PasteFromOffice ]
  53. },
  54. skip: {
  55. safari: [ 'combined' ] // Skip due to spacing issue (#13).
  56. }
  57. } );
  58. generateTests( {
  59. input: 'list',
  60. type: 'integration',
  61. browsers,
  62. editorConfig: {
  63. plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Link, List, PasteFromOffice ]
  64. },
  65. skip: {
  66. safari: [ 'heading3Styled' ] // Skip due to spacing issue (#13).
  67. }
  68. } );
  69. generateTests( {
  70. input: 'spacing',
  71. type: 'integration',
  72. browsers,
  73. editorConfig: {
  74. plugins: [ Clipboard, Paragraph, Bold, Italic, Underline, PasteFromOffice ]
  75. }
  76. } );
  77. generateTests( {
  78. input: 'google-docs-bold-wrapper',
  79. type: 'integration',
  80. browsers,
  81. editorConfig: {
  82. plugins: [ Clipboard, Paragraph, Bold, PasteFromOffice ]
  83. }
  84. } );
  85. generateTests( {
  86. input: 'google-docs-list',
  87. type: 'integration',
  88. browsers,
  89. editorConfig: {
  90. plugins: [ Clipboard, Paragraph, List, PasteFromOffice ]
  91. }
  92. } );
  93. generateTests( {
  94. input: 'generic-list-in-table',
  95. type: 'integration',
  96. browsers,
  97. editorConfig: {
  98. plugins: [ Clipboard, Paragraph, List, Table, Bold, PasteFromOffice ]
  99. }
  100. } );
  101. } );