normalizetoolbarconfig.js 827 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import normalizeToolbarConfig from '../../src/toolbar/normalizetoolbarconfig';
  6. describe( 'normalizeToolbarConfig()', () => {
  7. it( 'normalizes the config specified as an Array', () => {
  8. const cfg = [ 'foo', 'bar' ];
  9. const normalized = normalizeToolbarConfig( cfg );
  10. expect( normalized ).to.be.an( 'object' );
  11. expect( normalized.items ).to.equal( cfg );
  12. } );
  13. it( 'passes through an already normalized config', () => {
  14. const cfg = {
  15. items: [ 'foo', 'bar' ],
  16. foo: 'bar'
  17. };
  18. const normalized = normalizeToolbarConfig( cfg );
  19. expect( normalized ).to.equal( cfg );
  20. expect( normalized.items ).to.equal( cfg.items );
  21. expect( normalized.foo ).to.equal( cfg.foo );
  22. } );
  23. } );