streamGroup.spec.jsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React from 'react';
  2. import {initializeOrg} from 'sentry-test/initializeOrg';
  3. import {mountWithTheme} from 'sentry-test/enzyme';
  4. import GroupStore from 'app/stores/groupStore';
  5. import StreamGroup from 'app/components/stream/group';
  6. describe('StreamGroup', function() {
  7. let GROUP_1;
  8. beforeEach(function() {
  9. GROUP_1 = TestStubs.Group({
  10. id: '1337',
  11. project: {
  12. id: '13',
  13. slug: 'test',
  14. },
  15. type: 'error',
  16. });
  17. jest.spyOn(GroupStore, 'get').mockImplementation(() => GROUP_1);
  18. });
  19. afterEach(function() {});
  20. it('renders with anchors', function() {
  21. const {routerContext} = initializeOrg();
  22. const component = mountWithTheme(
  23. <StreamGroup
  24. id="1L"
  25. orgId="orgId"
  26. groupId="groupId"
  27. lastSeen="2017-07-25T22:56:12Z"
  28. firstSeen="2017-07-01T02:06:02Z"
  29. hasGuideAnchor
  30. {...routerContext}
  31. />,
  32. routerContext
  33. );
  34. expect(component.find('GuideAnchor').exists()).toBe(true);
  35. expect(component.find('GuideAnchor')).toHaveLength(2);
  36. expect(component).toSnapshot();
  37. });
  38. });