Browse Source

feat(uptime): Add uptime alert fixture (#75308)

Adding simple fixture here to help with testing

Depends on:
- #75086
David Wang 7 months ago
parent
commit
7b1f115258
1 changed files with 17 additions and 0 deletions
  1. 17 0
      tests/js/fixtures/uptimeRule.ts

+ 17 - 0
tests/js/fixtures/uptimeRule.ts

@@ -0,0 +1,17 @@
+import { ActorFixture } from "sentry-fixture/actor";
+import { UptimeMonitorMode, UptimeMonitorStatus, UptimeRule } from "sentry/views/alerts/rules/uptime/types";
+
+export function UptimeRuleFixture(params: Partial<UptimeRule> = {}): UptimeRule {
+  return {
+    id: '1',
+    intervalSeconds: 5,
+    mode: UptimeMonitorMode.AUTO_DETECTED_ACTIVE,
+    name: 'Uptime Rule',
+    owner: ActorFixture(),
+    projectSlug: 'project-slug',
+    status: UptimeMonitorStatus.OK,
+    timeoutMs: 5000,
+    url: 'https://sentry.io/',
+    ...params,
+  }
+}