streamGroup.spec.jsx 997 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import {shallow} from 'sentry-test/enzyme';
  3. import GroupStore from 'app/stores/groupStore';
  4. import StreamGroup from 'app/components/stream/group';
  5. // jest.mock('app/mixins/projectState');
  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 component = shallow(
  22. <StreamGroup
  23. id="1L"
  24. orgId="orgId"
  25. groupId="groupId"
  26. lastSeen="2017-07-25T22:56:12Z"
  27. firstSeen="2017-07-01T02:06:02Z"
  28. hasGuideAnchor
  29. />
  30. );
  31. expect(component.find('GuideAnchor').exists()).toBe(true);
  32. expect(component.find('GuideAnchor')).toHaveLength(1);
  33. expect(component).toMatchSnapshot();
  34. });
  35. });