projectOwnership.spec.jsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React from 'react';
  2. import {shallow} from 'sentry-test/enzyme';
  3. import {Client} from 'app/api';
  4. import ProjectOwnership from 'app/views/settings/project/projectOwnership';
  5. describe('ProjectTeamsSettings', function() {
  6. let org;
  7. let project;
  8. beforeEach(function() {
  9. org = TestStubs.Organization();
  10. project = TestStubs.ProjectDetails();
  11. Client.addMockResponse({
  12. url: `/projects/${org.slug}/${project.slug}/`,
  13. method: 'GET',
  14. body: project,
  15. });
  16. Client.addMockResponse({
  17. url: `/projects/${org.slug}/${project.slug}/ownership/`,
  18. method: 'GET',
  19. body: {
  20. raw: 'url:src @dummy@example.com',
  21. fallthrough: 'false',
  22. autoAssignment: 'false',
  23. },
  24. });
  25. });
  26. describe('render()', function() {
  27. it('renders', function() {
  28. const wrapper = shallow(
  29. <ProjectOwnership
  30. params={{orgId: org.slug, projectId: project.slug}}
  31. organization={org}
  32. project={project}
  33. />,
  34. TestStubs.routerContext()
  35. );
  36. expect(wrapper).toMatchSnapshot();
  37. });
  38. });
  39. });