metricRule.ts 810 B

1234567891011121314151617181920212223242526272829
  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. activations: [],
  9. status: 0,
  10. dateCreated: '2019-07-31T23:02:02.731Z',
  11. dataset: Dataset.ERRORS,
  12. query: '',
  13. id: '4',
  14. snooze: false,
  15. name: 'My Incident Rule',
  16. timeWindow: 60,
  17. aggregate: 'count()',
  18. projects: ['project-slug'],
  19. dateModified: '2019-07-31T23:02:02.731Z',
  20. triggers: [IncidentTriggerFixture()],
  21. resolveThreshold: 36,
  22. thresholdType: 0,
  23. thresholdPeriod: 1,
  24. environment: null,
  25. ...params,
  26. };
  27. }