streamGroup.spec.jsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. groupId="groupId"
  30. lastSeen="2017-07-25T22:56:12Z"
  31. firstSeen="2017-07-01T02:06:02Z"
  32. hasGuideAnchor={true}
  33. />
  34. );
  35. expect(component.find('GuideAnchor').exists()).toBe(true);
  36. expect(component.find('GuideAnchor')).toHaveLength(3);
  37. expect(component).toMatchSnapshot();
  38. });
  39. });