googledocsnormalizer.js 1.1 KB

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