You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
774 B

import TimeGrainConverter from './time_grain_converter';
describe('TimeGrainConverter', () => {
describe('with duration of PT1H', () => {
it('should convert it to text', () => {
expect(TimeGrainConverter.createTimeGrainFromISO8601Duration('PT1H')).toEqual('1 hour');
});
it('should convert it to kbn', () => {
expect(TimeGrainConverter.createKbnUnitFromISO8601Duration('PT1H')).toEqual('1h');
});
});
describe('with duration of P1D', () => {
it('should convert it to text', () => {
expect(TimeGrainConverter.createTimeGrainFromISO8601Duration('P1D')).toEqual('1 day');
});
it('should convert it to kbn', () => {
expect(TimeGrainConverter.createKbnUnitFromISO8601Duration('P1D')).toEqual('1d');
});
});
});