restricteddocument.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. /* global document */
  6. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  7. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  8. import RestrictedEditingException from './../src/restricteddocument';
  9. import RestrictedEditingExceptionUI from './../src/restricteddocumentui';
  10. import RestrictedEditingExceptionEditing from './../src/restricteddocumentediting';
  11. describe( 'RestrictedEditingException', () => {
  12. let editor, element;
  13. testUtils.createSinonSandbox();
  14. beforeEach( async () => {
  15. element = document.createElement( 'div' );
  16. document.body.appendChild( element );
  17. editor = await ClassicTestEditor.create( element, { plugins: [ RestrictedEditingException ] } );
  18. } );
  19. afterEach( () => {
  20. element.remove();
  21. return editor.destroy();
  22. } );
  23. it( 'should be named', () => {
  24. expect( RestrictedEditingException.pluginName ).to.equal( 'RestrictedEditingException' );
  25. } );
  26. it( 'should load the RestrictedEditingExceptionEditing plugin', () => {
  27. expect( editor.plugins.get( RestrictedEditingExceptionEditing ) ).to.be.instanceOf( RestrictedEditingExceptionEditing );
  28. } );
  29. it( 'should load the RestrictedEditingExceptionUI plugin', () => {
  30. expect( editor.plugins.get( RestrictedEditingExceptionUI ) ).to.be.instanceOf( RestrictedEditingExceptionUI );
  31. } );
  32. } );