teamAlertsTriggered.spec.tsx 948 B

1234567891011121314151617181920212223242526272829303132
  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 project = TestStubs.Project();
  8. const alertsTriggeredApi = MockApiClient.addMockResponse({
  9. url: `/teams/${organization.slug}/${team.slug}/alerts-triggered/`,
  10. body: TestStubs.TeamAlertsTriggered(),
  11. });
  12. MockApiClient.addMockResponse({
  13. url: `/teams/${organization.slug}/${team.slug}/alerts-triggered-index/`,
  14. body: [],
  15. });
  16. render(
  17. <TeamAlertsTriggered
  18. organization={organization}
  19. projects={[project]}
  20. teamSlug={team.slug}
  21. period="8w"
  22. />
  23. );
  24. expect(alertsTriggeredApi).toHaveBeenCalledTimes(1);
  25. });
  26. });