projectAlertRule.ts 773 B

123456789101112131415161718192021222324252627282930313233
  1. import {IssueAlertRule} from 'sentry/types/alerts';
  2. export function ProjectAlertRuleFixture(
  3. params: Partial<IssueAlertRule> = {}
  4. ): IssueAlertRule {
  5. return {
  6. id: '1',
  7. name: 'My alert rule',
  8. environment: 'staging',
  9. actionMatch: 'all',
  10. filterMatch: 'all',
  11. conditions: [
  12. {
  13. id: 'sentry.rules.conditions.first_seen_event.FirstSeenEventCondition',
  14. name: 'A new issue is created',
  15. },
  16. ],
  17. actions: [
  18. {
  19. id: 'sentry.rules.actions.notify_event.NotifyEventAction',
  20. name: 'Send a notification (for all legacy integrations)',
  21. },
  22. ],
  23. filters: [],
  24. createdBy: null,
  25. dateCreated: '',
  26. projects: [],
  27. snooze: false,
  28. frequency: 1,
  29. status: 'active',
  30. ...params,
  31. };
  32. }