diff options
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/jqTree/src_test/test_util.js')
-rw-r--r-- | ecomp-portal-FE/client/bower_components/jqTree/src_test/test_util.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ecomp-portal-FE/client/bower_components/jqTree/src_test/test_util.js b/ecomp-portal-FE/client/bower_components/jqTree/src_test/test_util.js new file mode 100644 index 00000000..18b6464e --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/jqTree/src_test/test_util.js @@ -0,0 +1,34 @@ +var utils_for_test = require('./utils_for_test'); + +var tree_vars = utils_for_test.getTreeVariables(); + +var Position = tree_vars.Position; +var util = tree_vars.util; + +var test = QUnit.test; + + +QUnit.module('util'); + +test('indexOf', function(assert) { + var _indexOf = util._indexOf; + var indexOf = util.indexOf; + + assert.equal(indexOf([3, 2, 1], 1), 2); + assert.equal(_indexOf([3, 2, 1], 1), 2); + assert.equal(indexOf([4, 5, 6], 1), -1); + assert.equal(_indexOf([4, 5, 6], 1), -1); +}); + +test('Position.getName', function(assert) { + assert.equal(Position.getName(Position.BEFORE), 'before'); + assert.equal(Position.getName(Position.AFTER), 'after'); + assert.equal(Position.getName(Position.INSIDE), 'inside'); + assert.equal(Position.getName(Position.NONE), 'none'); +}); + +test('Position.nameToIndex', function(assert) { + assert.equal(Position.nameToIndex('before'), Position.BEFORE); + assert.equal(Position.nameToIndex('after'), Position.AFTER); + assert.equal(Position.nameToIndex(''), 0); +}); |