monitor.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import {
  2. type Monitor,
  3. MonitorStatus,
  4. MonitorType,
  5. ScheduleType,
  6. } from 'sentry/views/monitors/types';
  7. import {ProjectFixture} from './project';
  8. export function MonitorFixture(params: Partial<Monitor> = {}): Monitor {
  9. return {
  10. id: '',
  11. isMuted: false,
  12. name: 'My Monitor',
  13. project: ProjectFixture(),
  14. slug: 'my-monitor',
  15. status: 'active',
  16. type: MonitorType.CRON_JOB,
  17. config: {
  18. checkin_margin: 5,
  19. max_runtime: 10,
  20. timezone: 'America/Los_Angeles',
  21. alert_rule_id: 1234,
  22. failure_issue_threshold: 2,
  23. recovery_threshold: 2,
  24. schedule_type: ScheduleType.CRONTAB,
  25. schedule: '10 * * * *',
  26. },
  27. dateCreated: '2023-01-01T00:00:00Z',
  28. environments: [
  29. {
  30. dateCreated: '2023-01-01T00:10:00Z',
  31. isMuted: false,
  32. lastCheckIn: '2023-12-25T17:13:00Z',
  33. name: 'production',
  34. nextCheckIn: '2023-12-25T16:10:00Z',
  35. nextCheckInLatest: '2023-12-25T15:15:00Z',
  36. status: MonitorStatus.OK,
  37. activeIncident: null,
  38. },
  39. ],
  40. alertRule: {
  41. targets: [{targetIdentifier: 1, targetType: 'Member'}],
  42. },
  43. ...params,
  44. };
  45. }