8
0

editorconfig.js 908 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. import EditorConfig from '/ckeditor5/core/editorconfig.js';
  7. import CKEDITOR from '/ckeditor.js';
  8. let config;
  9. beforeEach( () => {
  10. config = new EditorConfig( {
  11. test: 1
  12. } );
  13. } );
  14. describe( 'constructor', () => {
  15. it( 'should set configurations', () => {
  16. expect( config ).to.have.property( 'test' ).to.equal( 1 );
  17. } );
  18. } );
  19. describe( 'get', () => {
  20. it( 'should retrieve a configuration', () => {
  21. expect( config.get( 'test' ) ).to.equal( 1 );
  22. } );
  23. it( 'should fallback to CKEDITOR.config', () => {
  24. CKEDITOR.config.set( {
  25. globalConfig: 2
  26. } );
  27. expect( config.get( 'globalConfig' ) ).to.equal( 2 );
  28. } );
  29. it( 'should return undefined for non existing configuration', () => {
  30. expect( config.get( 'invalid' ) ).to.be.undefined();
  31. } );
  32. } );