streamGroup.spec.jsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import React from 'react';
  2. import {shallow} from '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 sandbox;
  8. let GROUP_1;
  9. beforeEach(function() {
  10. sandbox = sinon.sandbox.create();
  11. GROUP_1 = TestStubs.Group({
  12. id: '1337',
  13. project: {
  14. id: '13',
  15. slug: 'test',
  16. },
  17. type: 'error',
  18. });
  19. sandbox.stub(GroupStore, 'get').returns(GROUP_1);
  20. });
  21. afterEach(function() {
  22. sandbox.restore();
  23. });
  24. it('renders with anchors', function() {
  25. let component = shallow(
  26. <StreamGroup
  27. id="1L"
  28. orgId="orgId"
  29. projectId="projectId"
  30. groupId="groupId"
  31. lastSeen="2017-07-25T22:56:12Z"
  32. firstSeen="2017-07-01T02:06:02Z"
  33. hasGuideAnchor={true}
  34. />
  35. );
  36. expect(component.find('GuideAnchor').exists()).toBe(true);
  37. expect(component.find('GuideAnchor')).toHaveLength(3);
  38. expect(component).toMatchSnapshot();
  39. });
  40. });