teamAlertsTriggered.spec.jsx 847 B

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