|
@@ -1,12 +1,7 @@
|
|
|
import {UserFixture} from 'sentry-fixture/user';
|
|
|
|
|
|
import ConfigStore from 'sentry/stores/configStore';
|
|
|
-import {
|
|
|
- getTimeFormat,
|
|
|
- parsePeriodToHours,
|
|
|
- setDateToTime,
|
|
|
- shouldUse24Hours,
|
|
|
-} from 'sentry/utils/dates';
|
|
|
+import {getTimeFormat, setDateToTime, shouldUse24Hours} from 'sentry/utils/dates';
|
|
|
|
|
|
describe('utils.dates', function () {
|
|
|
describe('setDateToTime', function () {
|
|
@@ -29,23 +24,6 @@ describe('utils.dates', function () {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- describe('parsePeriodToHours()', function () {
|
|
|
- it('can convert standard formats', function () {
|
|
|
- expect(parsePeriodToHours('30s').toFixed(4)).toBe('0.0083');
|
|
|
- expect(parsePeriodToHours('1m').toFixed(4)).toBe('0.0167');
|
|
|
- expect(parsePeriodToHours('1h')).toBe(1);
|
|
|
- expect(parsePeriodToHours('24h')).toBe(24);
|
|
|
- expect(parsePeriodToHours('1d')).toBe(24);
|
|
|
- expect(parsePeriodToHours('2w')).toBe(336);
|
|
|
- });
|
|
|
-
|
|
|
- it('handle invalid statsPeriod', function () {
|
|
|
- expect(parsePeriodToHours('24')).toBe(24 / 3600);
|
|
|
- expect(parsePeriodToHours('')).toBe(-1);
|
|
|
- expect(parsePeriodToHours('24x')).toBe(-1);
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
describe('user clock preferences', function () {
|
|
|
afterEach(function () {
|
|
|
ConfigStore.set('user', UserFixture({}));
|