restrictededitingmode.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. /* global document */
  6. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  7. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  8. import RestrictedEditingMode from './../src/restrictededitingmode';
  9. import RestrictedEditingModeUI from './../src/restrictededitingmodeui';
  10. import RestrictedEditingModeEditing from './../src/restrictededitingmodeediting';
  11. describe( 'RestrictedEditingMode', () => {
  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: [ RestrictedEditingMode ] } );
  18. } );
  19. afterEach( () => {
  20. element.remove();
  21. return editor.destroy();
  22. } );
  23. it( 'should be named', () => {
  24. expect( RestrictedEditingMode.pluginName ).to.equal( 'RestrictedEditingMode' );
  25. } );
  26. it( 'should load the RestrictedEditingModeEditing plugin', () => {
  27. expect( editor.plugins.get( RestrictedEditingModeEditing ) ).to.be.instanceOf( RestrictedEditingModeEditing );
  28. } );
  29. it( 'should load the RestrictedEditingModeUI plugin', () => {
  30. expect( editor.plugins.get( RestrictedEditingModeUI ) ).to.be.instanceOf( RestrictedEditingModeUI );
  31. } );
  32. } );