integration.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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( 'Paste from Office - automatic', () => {
  22. generateTests( {
  23. input: 'basic-styles',
  24. type: 'integration',
  25. dataSource: 'MS Word',
  26. browsers,
  27. editorConfig: {
  28. plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Strikethrough, PasteFromOffice ]
  29. },
  30. skip: {
  31. safari: [ 'italicStartingText', 'multipleStylesSingleLine', 'multipleStylesMultiline' ] // Skip due to spacing issue (#13).
  32. }
  33. } );
  34. generateTests( {
  35. input: 'image',
  36. type: 'integration',
  37. dataSource: 'MS Word',
  38. browsers,
  39. editorConfig: {
  40. plugins: [ Clipboard, Paragraph, Image, Table, PasteFromOffice ]
  41. },
  42. skip: {
  43. chrome: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
  44. firefox: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
  45. safari: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
  46. edge: ( env.isEdge ? [] : [ 'adjacentGroups' ] )
  47. }
  48. } );
  49. generateTests( {
  50. input: 'link',
  51. type: 'integration',
  52. dataSource: 'MS Word',
  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. dataSource: 'MS Word',
  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. dataSource: 'MS Word',
  77. browsers,
  78. editorConfig: {
  79. plugins: [ Clipboard, Paragraph, Bold, Italic, Underline, PasteFromOffice ]
  80. }
  81. } );
  82. generateTests( {
  83. input: 'simpleText',
  84. type: 'integration',
  85. dataSource: 'Google Docs',
  86. browsers,
  87. editorConfig: {
  88. plugins: [ Clipboard, Paragraph, Bold, PasteFromOffice ]
  89. }
  90. } );
  91. } );