utils.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. import { isDefault, isSupported, supportedOptions } from '../src/utils';
  6. describe( 'utils', () => {
  7. describe( 'isDefault()', () => {
  8. it( 'should return true for "left" alignment only', () => {
  9. expect( isDefault( 'left' ) ).to.be.true;
  10. expect( isDefault( 'right' ) ).to.be.false;
  11. expect( isDefault( 'center' ) ).to.be.false;
  12. expect( isDefault( 'justify' ) ).to.be.false;
  13. } );
  14. } );
  15. describe( 'isSupported()', () => {
  16. it( 'should return true for supported alignments', () => {
  17. expect( isSupported( 'left' ) ).to.be.true;
  18. expect( isSupported( 'right' ) ).to.be.true;
  19. expect( isSupported( 'center' ) ).to.be.true;
  20. expect( isSupported( 'justify' ) ).to.be.true;
  21. expect( isSupported( '' ) ).to.be.false;
  22. expect( isSupported( 'middle' ) ).to.be.false;
  23. } );
  24. } );
  25. describe( 'supportedOptions', () => {
  26. it( 'should be set', () => {
  27. expect( supportedOptions ).to.deep.equal( [ 'left', 'right', 'center', 'justify' ] );
  28. } );
  29. } );
  30. } );