feat(timepicker2): temporarily removed the the option to define custom quick range, will have to be part of future issue, closes #2761

This commit is contained in:
Torkel Ödegaard
2015-09-19 12:20:24 +02:00
parent 86f4907cc4
commit 2f68687de9
5 changed files with 46 additions and 27 deletions

View File

@@ -6,6 +6,22 @@ import moment = require('moment')
describe("rangeUtil", () => {
describe("Can get range grouped list of ranges", () => {
it('when custom settings should return default range list', () => {
var groups = rangeUtil.getRelativeTimesList({time_options: []}, 'Last 5 minutes');
expect(_.keys(groups).length).to.be(4)
expect(groups[3][0].active).to.be(true)
});
// it('should add custom options to right section', () => {
// var groups = rangeUtil.getRelativeTimesList({
// time_options: ['12m', '15d']
// }, '');
// var value = _.findWhere(groups["3"], {display: 'Last 12 minutes'});
// expect(value).to.not.be(undefined)
// });
});
describe("Can get range text described", () => {
it('should handle simple old expression with only amount and unit', () => {
var info = rangeUtil.describeTextRange('5m');