-import { hoursToMilliseconds } from 'date-fns';
+import { hoursToMilliseconds, hoursToSeconds } from 'date-fns';
import { expect } from 'expect';
import { Constants } from '../../src/utils/Constants';
convertToFloat,
convertToInt,
formatDurationMilliSeconds,
+ formatDurationSeconds,
generateUUID,
getRandomFloat,
getRandomInteger,
expect(formatDurationMilliSeconds(hoursToMilliseconds(4380))).toBe('182 days 12 hours');
});
+ it('Verify formatDurationSeconds()', () => {
+ expect(formatDurationSeconds(0)).toBe('');
+ expect(formatDurationSeconds(1)).toBe('1 second');
+ expect(formatDurationSeconds(hoursToSeconds(4380))).toBe('182 days 12 hours');
+ });
+
it('Verify isValidDate()', () => {
expect(isValidDate(undefined)).toBe(false);
expect(isValidDate(null)).toBe(false);