projectDebugFiles.spec.jsx 1017 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React from 'react';
  2. import {shallow, mount} from 'enzyme';
  3. import {Client} from 'app/api';
  4. import ProjectDebugFiles from 'app/views/projectDebugFiles';
  5. const ENDPOINT = '/projects/org/project/files/dsyms/';
  6. describe('ProjectDebugFiles', function() {
  7. beforeEach(function() {
  8. Client.clearMockResponses();
  9. });
  10. it('renders empty', function() {
  11. Client.addMockResponse({
  12. url: ENDPOINT,
  13. body: [],
  14. });
  15. let wrapper = shallow(
  16. <ProjectDebugFiles params={{orgId: 'org', projectId: 'project'}} />,
  17. TestStubs.routerContext()
  18. );
  19. expect(wrapper).toMatchSnapshot();
  20. });
  21. it('renders', function() {
  22. Client.addMockResponse({
  23. url: ENDPOINT,
  24. body: TestStubs.DebugSymbols(),
  25. });
  26. Client.addMockResponse({
  27. url: ENDPOINT,
  28. method: 'PUT',
  29. });
  30. let wrapper = mount(
  31. <ProjectDebugFiles params={{orgId: 'org', projectId: 'project'}} />,
  32. TestStubs.routerContext()
  33. );
  34. expect(wrapper).toMatchSnapshot();
  35. });
  36. });