index.spec.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {render} from 'sentry-test/reactTestingLibrary';
  2. import SharedGroupDetails from 'sentry/views/sharedGroupDetails';
  3. describe('SharedGroupDetails', function () {
  4. const eventEntry = TestStubs.EventEntry();
  5. const exception = TestStubs.EventStacktraceException().entries[0];
  6. const params = {shareId: 'a'};
  7. const router = TestStubs.router({params});
  8. beforeEach(function () {
  9. MockApiClient.addMockResponse({
  10. url: '/shared/issues/a/',
  11. body: TestStubs.Group({
  12. title: 'ZeroDivisionError',
  13. latestEvent: TestStubs.Event({
  14. entries: [eventEntry, exception],
  15. }),
  16. project: TestStubs.Project({organization: {slug: 'test-org'}}),
  17. }),
  18. });
  19. });
  20. afterEach(function () {
  21. MockApiClient.clearMockResponses();
  22. });
  23. it('renders', function () {
  24. const {container} = render(
  25. <SharedGroupDetails
  26. params={params}
  27. api={new MockApiClient()}
  28. route={{}}
  29. router={router}
  30. routes={router.routes}
  31. routeParams={router.params}
  32. location={router.location}
  33. />
  34. );
  35. expect(container).toSnapshot();
  36. });
  37. });