autosave.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * Copyright (c) 2016 - 2017, CKSource - Frederico Knabben. All rights reserved.
  3. */
  4. /* globals document */
  5. // import ModelText from '@ckeditor/ckeditor5-engine/src/model/text';
  6. // import ModelRange from '@ckeditor/ckeditor5-engine/src/model/range';
  7. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  8. import Autosave from '../src/autosave';
  9. describe( 'Autosave', () => {
  10. const sandbox = sinon.sandbox.create();
  11. let editor, element, autosave;
  12. beforeEach( () => {
  13. element = document.createElement( 'div' );
  14. document.body.appendChild( element );
  15. return ClassicTestEditor
  16. .create( element, {
  17. plugins: []
  18. } )
  19. .then( _editor => {
  20. editor = _editor;
  21. autosave = editor.plugins.get( Autosave );
  22. } );
  23. } );
  24. afterEach( () => {
  25. document.body.removeChild( element );
  26. sandbox.restore();
  27. return editor.destroy();
  28. } );
  29. it( 'should have static pluginName property', () => {
  30. expect( Autosave.pluginName ).to.equal( 'Autosave' );
  31. } );
  32. describe( 'initialization', () => {
  33. it( 'should initialize provider with an undefined value', () => {
  34. expect( autosave.provider ).to.be.undefined;
  35. } );
  36. } );
  37. } );