teamAlertsTriggered.spec.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import {Organization} from 'sentry-fixture/organization';
  2. import {Team} from 'sentry-fixture/team';
  3. import {TeamAlertsTriggered as TeamAlertsTriggeredFixture} from 'sentry-fixture/teamAlertsTriggered';
  4. import {render} from 'sentry-test/reactTestingLibrary';
  5. import TeamAlertsTriggered from 'sentry/views/organizationStats/teamInsights/teamAlertsTriggered';
  6. describe('TeamAlertsTriggered', () => {
  7. it('should render graph of alerts triggered', () => {
  8. const team = Team();
  9. const organization = Organization();
  10. const project = TestStubs.Project();
  11. const alertsTriggeredApi = MockApiClient.addMockResponse({
  12. url: `/teams/${organization.slug}/${team.slug}/alerts-triggered/`,
  13. body: TeamAlertsTriggeredFixture(),
  14. });
  15. MockApiClient.addMockResponse({
  16. url: `/teams/${organization.slug}/${team.slug}/alerts-triggered-index/`,
  17. body: [],
  18. });
  19. render(
  20. <TeamAlertsTriggered
  21. organization={organization}
  22. projects={[project]}
  23. teamSlug={team.slug}
  24. period="8w"
  25. />
  26. );
  27. expect(alertsTriggeredApi).toHaveBeenCalledTimes(1);
  28. });
  29. });