restricteddocument.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 './_utils/utils';
  7. import ClassicTestEditor from './_utils/classictesteditor';
  8. import RestrictedDocument from './../src/restricteddocument';
  9. import RestrictedDocumentUI from './../src/restricteddocumentui';
  10. import RestrictedDocumentEditing from './../src/restricteddocumentediting';
  11. describe( 'RestrictedDocument', () => {
  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: [ RestrictedDocument ] } );
  18. } );
  19. afterEach( () => {
  20. element.remove();
  21. if ( editor ) {
  22. return editor.destroy();
  23. }
  24. } );
  25. it( 'should be named', () => {
  26. expect( RestrictedDocument.pluginName ).to.equal( 'RestrictedDocument' );
  27. } );
  28. it( 'should load the RestrictedDocumentEditing plugin', () => {
  29. expect( editor.plugins.get( RestrictedDocumentEditing ) ).to.be.instanceOf( RestrictedDocumentEditing );
  30. } );
  31. it( 'should load the RestrictedDocumentUI plugin', () => {
  32. expect( editor.plugins.get( RestrictedDocumentUI ) ).to.be.instanceOf( RestrictedDocumentUI );
  33. } );
  34. } );