operationfactory.js 755 B

1234567891011121314151617181920212223242526
  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. import Model from '../../../src/model/model';
  6. import NoOperation from '../../../src/model/operation/nooperation';
  7. import OperationFactory from '../../../src/model/operation/operationfactory';
  8. describe( 'OperationFactory', () => {
  9. let model;
  10. beforeEach( () => {
  11. model = new Model();
  12. } );
  13. it( 'should create operation from JSON', () => {
  14. const operation = OperationFactory.fromJSON( {
  15. __className: 'NoOperation',
  16. baseVersion: 0
  17. }, model.doc );
  18. expect( operation ).to.instanceof( NoOperation );
  19. expect( operation.baseVersion ).to.equal( 0 );
  20. } );
  21. } );