|
|
@@ -0,0 +1,34 @@
|
|
|
+/**
|
|
|
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
|
|
|
+ * For licensing, see LICENSE.md.
|
|
|
+ */
|
|
|
+
|
|
|
+import env, { isMac } from '/ckeditor5/utils/env.js';
|
|
|
+
|
|
|
+describe( 'Env', () => {
|
|
|
+ beforeEach( () => {
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'is an object', () => {
|
|
|
+ expect( env ).to.be.an( 'object' );
|
|
|
+ } );
|
|
|
+
|
|
|
+ describe( 'mac', () => {
|
|
|
+ it( 'is a boolean', () => {
|
|
|
+ expect( env.mac ).to.be.a( 'boolean' );
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+
|
|
|
+ describe( 'isMac', () => {
|
|
|
+ it( 'returns true for macintosh UA strings', () => {
|
|
|
+ expect( isMac( 'macintosh' ) ).to.be.true;
|
|
|
+ expect( isMac( 'foo macintosh bar' ) ).to.be.true;
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'returns false for non–macintosh UA strings', () => {
|
|
|
+ expect( isMac( '' ) ).to.be.false;
|
|
|
+ expect( isMac( 'mac' ) ).to.be.false;
|
|
|
+ expect( isMac( 'foo' ) ).to.be.false;
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+} );
|