1653.js 906 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  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 invoke `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 spy = sinon.spy( editor.editing.view, 'render' );
  18. editor.data.parse( '<p></p>' );
  19. sinon.assert.notCalled( spy );
  20. } )
  21. .then( () => {
  22. element.remove();
  23. return editor.destroy();
  24. } );
  25. } );
  26. } );