teamAlertsTriggered.spec.tsx 1.0 KB

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