actions.spec.jsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import React from 'react';
  2. import {shallow} from 'enzyme';
  3. import GroupActions from 'app/views/groupDetails/shared/actions';
  4. import ConfigStore from 'app/stores/configStore';
  5. describe('GroupActions', function() {
  6. let sandbox;
  7. beforeEach(function() {
  8. sandbox = sinon.sandbox.create();
  9. sandbox.stub(ConfigStore, 'get').returns([]);
  10. });
  11. afterEach(function() {
  12. sandbox.restore();
  13. });
  14. describe('render()', function() {
  15. it('renders correctly', function() {
  16. let wrapper = shallow(
  17. <GroupActions
  18. group={TestStubs.Group({
  19. id: '1337',
  20. pluginActions: [],
  21. pluginIssues: [],
  22. })}
  23. project={TestStubs.ProjectDetails({
  24. id: '2448',
  25. name: 'project name',
  26. slug: 'project',
  27. })}
  28. />,
  29. {
  30. context: {
  31. organization: TestStubs.Organization({
  32. id: '4660',
  33. slug: 'org',
  34. }),
  35. },
  36. }
  37. );
  38. expect(wrapper).toMatchSnapshot();
  39. });
  40. });
  41. });