summaryrefslogtreecommitdiffstats
path: root/toolkit/components/microformats/test/module-tests/utilities-test.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:55:19 +0200
commiteb70e6e3d0bff11c25f14b1196025791bf2308fb (patch)
tree5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/microformats/test/module-tests/utilities-test.js
parent32ead795290b3399d56b4708fc75b77d296f6a1a (diff)
downloadUXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/microformats/test/module-tests/utilities-test.js')
-rw-r--r--toolkit/components/microformats/test/module-tests/utilities-test.js93
1 files changed, 0 insertions, 93 deletions
diff --git a/toolkit/components/microformats/test/module-tests/utilities-test.js b/toolkit/components/microformats/test/module-tests/utilities-test.js
deleted file mode 100644
index b37236a6b..000000000
--- a/toolkit/components/microformats/test/module-tests/utilities-test.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Unit test for utilities
-*/
-
-assert = chai.assert;
-
-// Tests the private Modules.utils object
-// Modules.utils is unit tested as it has an interface access by other modules
-
-
-describe('Modules.utilities', function() {
-
-
- it('isString', function(){
- assert.isTrue( Modules.utils.isString( 'abc' ) );
- assert.isFalse( Modules.utils.isString( 123 ) );
- assert.isFalse( Modules.utils.isString( 1.23 ) );
- assert.isFalse( Modules.utils.isString( {'abc': 'abc'} ) );
- assert.isFalse( Modules.utils.isString( ['abc'] ) );
- assert.isFalse( Modules.utils.isString( true ) );
- });
-
-
- it('isArray', function(){
- assert.isTrue( Modules.utils.isArray( ['abc'] ) );
- assert.isFalse( Modules.utils.isArray( 123 ) );
- assert.isFalse( Modules.utils.isArray( 1.23 ) );
- assert.isFalse( Modules.utils.isArray( 'abc' ) );
- assert.isFalse( Modules.utils.isArray( {'abc': 'abc'} ) );
- assert.isFalse( Modules.utils.isArray( true ) );
- });
-
-
- it('isNumber', function(){
- assert.isTrue( Modules.utils.isNumber( 123 ) );
- assert.isTrue( Modules.utils.isNumber( 1.23 ) );
- assert.isFalse( Modules.utils.isNumber( 'abc' ) );
- assert.isFalse( Modules.utils.isNumber( {'abc': 'abc'} ) );
- assert.isFalse( Modules.utils.isNumber( ['abc'] ) );
- assert.isFalse( Modules.utils.isNumber( true ) );
- });
-
-
- it('startWith', function(){
- assert.isTrue( Modules.utils.startWith( 'p-name', 'p-' ) );
- assert.isFalse( Modules.utils.startWith( 'p-name', 'name' ) );
- assert.isFalse( Modules.utils.startWith( 'p-name', 'u-' ) );
- });
-
-
- it('trim', function(){
- assert.equal( Modules.utils.trim( ' Glenn Jones ' ), 'Glenn Jones' );
- assert.equal( Modules.utils.trim( 'Glenn Jones' ), 'Glenn Jones' );
- assert.equal( Modules.utils.trim( undefined ), '' );
- });
-
-
- it('replaceCharAt', function(){
- assert.equal( Modules.utils.replaceCharAt( 'Glenn Jones', 5, '-' ), 'Glenn-Jones' );
- assert.equal( Modules.utils.replaceCharAt( 'Glenn Jones', 50, '-' ), 'Glenn Jones' );
- });
-
-
- it('isOnlyWhiteSpace', function(){
- assert.isTrue( Modules.utils.isOnlyWhiteSpace( ' ') );
- assert.isTrue( Modules.utils.isOnlyWhiteSpace( ' \n\r') );
- assert.isFalse( Modules.utils.isOnlyWhiteSpace( ' text\n\r') );
- });
-
-
- it('collapseWhiteSpace', function(){
- assert.equal( Modules.utils.collapseWhiteSpace( ' '), ' ' );
- assert.equal( Modules.utils.collapseWhiteSpace( ' \n\r'), ' ' );
- assert.equal( Modules.utils.collapseWhiteSpace( ' text\n\r'), ' text ' );
- });
-
-
- it('hasProperties', function(){
- assert.isTrue( Modules.utils.hasProperties( {name: 'glennjones'} ) );
- assert.isFalse( Modules.utils.hasProperties( {} ) );
- });
-
-
- it('sortObjects', function(){
- var arr = [{'name': 'one'},{'name': 'two'},{'name': 'three'},{'name': 'three'}];
-
- assert.deepEqual( arr.sort( Modules.utils.sortObjects( 'name', true ) ), [{"name":"two"},{"name":"three"},{'name': 'three'},{"name":"one"}] );
- assert.deepEqual( arr.sort( Modules.utils.sortObjects( 'name', false ) ), [{"name":"one"},{"name":"three"},{'name': 'three'},{"name":"two"}] );
- });
-
-
-
-});