teamAlertsTriggered.spec.tsx 1.1 KB

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