8
0

1653.js 998 B

123456789101112131415161718192021222324252627282930313233343536
  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. /* globals document */
  6. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  7. import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  8. describe( 'Bug ckeditor5-engine#1653', () => {
  9. it( '`DataController.parse()` should not fire `editing.view#render`', () => {
  10. let editor;
  11. const element = document.createElement( 'div' );
  12. document.body.appendChild( element );
  13. return ClassicTestEditor
  14. .create( element, { plugins: [ Paragraph ] } )
  15. .then( newEditor => {
  16. editor = newEditor;
  17. const editingViewSpy = sinon.spy();
  18. editor.editing.view.on( 'fire', editingViewSpy );
  19. editor.data.parse( '<p></p>' );
  20. sinon.assert.notCalled( editingViewSpy );
  21. } )
  22. .then( () => {
  23. element.remove();
  24. return editor.destroy();
  25. } );
  26. } );
  27. } );