diff options
Diffstat (limited to 'src/js/tests/specs/utils.js')
-rw-r--r-- | src/js/tests/specs/utils.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/js/tests/specs/utils.js b/src/js/tests/specs/utils.js new file mode 100644 index 0000000..f4ed399 --- /dev/null +++ b/src/js/tests/specs/utils.js @@ -0,0 +1,20 @@ + +describe('fiveui.utils', function() { + + describe('fiveui.utils.getNewId', function() { + + it('returns 0 when no elements are given', function() { + expect(fiveui.utils.getNewId([])).toBe(0); + }); + + it('returns 1, when 0 is given', function() { + expect(fiveui.utils.getNewId([0])).toBe(1); + }); + + it('ignores order when finding the maximum element', function() { + expect(fiveui.utils.getNewId([2,1])).toBe(3); + }); + + }); + +}); |