aboutsummaryrefslogtreecommitdiff
path: root/src/js/tests/specs/utils.js
blob: f4ed399e8b72d6a51085085bcdaf030085d7a914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
    });

  });

});