diff --git a/test/specs/unit/util.unit.js b/test/specs/unit/util.unit.js index bdfd511..68a4903 100755 --- a/test/specs/unit/util.unit.js +++ b/test/specs/unit/util.unit.js @@ -3,6 +3,28 @@ const { expect } = require('chai'); const util = require('../../../lib/util'); describe('util.js', () => { - context('isSortedHiToLow()', () => {}); - context('isSortedLowToHi()', () => {}); + context('isSortedHiToLow()', () => { + it('returns false when list is ascending', () => { + const list = [123, 456]; + const result = util.isSortedHiToLow(list); + expect(result).to.equal(false); + }); + it('returns true when list is descending', () => { + const list = [456, 123]; + const result = util.isSortedHiToLow(list); + expect(result).to.equal(true); + }); + }); + context('isSortedLowToHi()', () => { + it('returns true when list is ascending', () => { + const list = [123, 456]; + const result = util.isSortedLowToHi(list); + expect(result).to.equal(true); + }); + it('returns false when list is descending', () => { + const list = [456, 123]; + const result = util.isSortedLowToHi(list); + expect(result).to.equal(false); + }); + }); });