imagecaptioningengine.js 997 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
  6. import ImageCaptioningEngine from '../../src/imagecaptioning/imagecaptioningengine';
  7. describe( 'ImageCaptioningEngine', () => {
  8. let editor, document, viewDocument;
  9. beforeEach( () => {
  10. return VirtualTestEditor.create( {
  11. plugins: [ ImageCaptioningEngine ]
  12. } )
  13. .then( newEditor => {
  14. editor = newEditor;
  15. document = editor.document;
  16. viewDocument = editor.editing.view;
  17. } );
  18. } );
  19. it( 'should be loaded', () => {
  20. expect( editor.plugins.get( ImageCaptioningEngine ) ).to.be.instanceOf( ImageCaptioningEngine );
  21. } );
  22. it( 'should set proper schema rules', () => {
  23. expect( document.schema.check( { name: 'caption', iniside: 'image' } ) ).to.be.true;
  24. expect( document.schema.check( { name: '$inline', inside: 'caption' } ) ).to.be.true;
  25. } );
  26. } );