mswordnormalizer.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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 MSWordNormalizer from '../../src/normalizer/mswordnormalizer';
  6. // `exec()` of the msword normalizer is tested with autogenerated normalization tests.
  7. describe( 'PasteFromOffice/normalizer/mswornormalizer', () => {
  8. const normalizer = new MSWordNormalizer();
  9. describe( 'isActive()', () => {
  10. describe( 'correct data set', () => {
  11. [
  12. '<meta name=Generator content="Microsoft Word 15"><p>Foo bar</p>',
  13. '<meta name=Generator content="Microsoft Word 15">'
  14. ].forEach( ( htmlString, index ) => {
  15. it( `should be active for: #${ index } data set`, () => {
  16. expect( normalizer.isActive( htmlString ) ).to.be.true;
  17. } );
  18. } );
  19. } );
  20. describe( 'wrong data set', () => {
  21. [
  22. '<p>foo</p>',
  23. '<p id="docs-internal-guid-12345678-1234-1234-1234-1234567890ab"></p>'
  24. ].forEach( ( htmlString, index ) => {
  25. it( `should be inactive to for: #${ index } data set`, () => {
  26. expect( normalizer.isActive( htmlString ) ).to.be.false;
  27. } );
  28. } );
  29. } );
  30. } );
  31. } );