metricRule.ts 789 B

12345678910111213141516171819202122232425262728
  1. import {IncidentTriggerFixture} from 'sentry-fixture/incidentTrigger';
  2. import type {SavedMetricRule as SavedMetricRule} from 'sentry/views/alerts/rules/metric/types';
  3. import {Dataset} from 'sentry/views/alerts/rules/metric/types';
  4. export function MetricRuleFixture(
  5. params: Partial<SavedMetricRule> = {}
  6. ): SavedMetricRule {
  7. return {
  8. status: 0,
  9. dateCreated: '2019-07-31T23:02:02.731Z',
  10. dataset: Dataset.ERRORS,
  11. query: '',
  12. id: '4',
  13. snooze: false,
  14. name: 'My Incident Rule',
  15. timeWindow: 60,
  16. aggregate: 'count()',
  17. projects: ['project-slug'],
  18. dateModified: '2019-07-31T23:02:02.731Z',
  19. triggers: [IncidentTriggerFixture()],
  20. resolveThreshold: 36,
  21. thresholdType: 0,
  22. thresholdPeriod: 1,
  23. environment: null,
  24. ...params,
  25. };
  26. }