env.js 816 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import env, { isMac } from 'ckeditor5/utils/env.js';
  6. describe( 'Env', () => {
  7. beforeEach( () => {
  8. } );
  9. it( 'is an object', () => {
  10. expect( env ).to.be.an( 'object' );
  11. } );
  12. describe( 'mac', () => {
  13. it( 'is a boolean', () => {
  14. expect( env.mac ).to.be.a( 'boolean' );
  15. } );
  16. } );
  17. describe( 'isMac', () => {
  18. it( 'returns true for macintosh UA strings', () => {
  19. expect( isMac( 'macintosh' ) ).to.be.true;
  20. expect( isMac( 'foo macintosh bar' ) ).to.be.true;
  21. } );
  22. it( 'returns false for non–macintosh UA strings', () => {
  23. expect( isMac( '' ) ).to.be.false;
  24. expect( isMac( 'mac' ) ).to.be.false;
  25. expect( isMac( 'foo' ) ).to.be.false;
  26. } );
  27. } );
  28. } );