useMetricsIntervalParam.spec.tsx 707 B

123456789101112131415161718192021
  1. import {getIntervalOptionsForStatsPeriod} from 'sentry/views/metrics/utils/useMetricsIntervalParam';
  2. describe('getIntervalOptionsForStatsPeriod', () => {
  3. it('returns options for mixed metrics', () => {
  4. expect(
  5. getIntervalOptionsForStatsPeriod({period: '1h', start: null, end: null, utc: null})
  6. ).toEqual([
  7. {value: '1m', label: '1 minute'},
  8. {value: '5m', label: '5 minutes'},
  9. {value: '15m', label: '15 minutes'},
  10. ]);
  11. expect(
  12. getIntervalOptionsForStatsPeriod({period: '90d', start: null, end: null, utc: null})
  13. ).toEqual([
  14. {value: '1d', label: '1 day'},
  15. {value: '1w', label: '1 week'},
  16. {value: '4w', label: '1 month'},
  17. ]);
  18. });
  19. });