resolutionBox.spec.jsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import React from 'react';
  2. import {shallow} from 'enzyme';
  3. import ResolutionBox from 'app/components/resolutionBox';
  4. describe('ResolutionBox', function() {
  5. describe('render()', function() {
  6. it('handles inNextRelease', function() {
  7. let wrapper = shallow(
  8. <ResolutionBox
  9. statusDetails={{inNextRelease: true}}
  10. params={{orgId: 'org', projectId: 'project'}}
  11. />
  12. );
  13. expect(wrapper).toMatchSnapshot();
  14. });
  15. it('handles inNextRelease with actor', function() {
  16. let wrapper = shallow(
  17. <ResolutionBox
  18. statusDetails={{
  19. inNextRelease: true,
  20. actor: {id: '111', name: 'David Cramer', email: 'david@sentry.io'},
  21. }}
  22. params={{orgId: 'org', projectId: 'project'}}
  23. />
  24. );
  25. expect(wrapper).toMatchSnapshot();
  26. });
  27. it('handles inRelease', function() {
  28. let wrapper = shallow(
  29. <ResolutionBox
  30. statusDetails={{
  31. inRelease: '1.0',
  32. }}
  33. params={{orgId: 'org', projectId: 'project'}}
  34. />
  35. );
  36. expect(wrapper).toMatchSnapshot();
  37. });
  38. it('handles inRelease with actor', function() {
  39. let wrapper = shallow(
  40. <ResolutionBox
  41. statusDetails={{
  42. inRelease: '1.0',
  43. actor: {id: '111', name: 'David Cramer', email: 'david@sentry.io'},
  44. }}
  45. params={{orgId: 'org', projectId: 'project'}}
  46. />
  47. );
  48. expect(wrapper).toMatchSnapshot();
  49. });
  50. it('handles default', function() {
  51. let wrapper = shallow(
  52. <ResolutionBox statusDetails={{}} params={{orgId: 'org', projectId: 'project'}} />
  53. );
  54. expect(wrapper).toMatchSnapshot();
  55. });
  56. it('handles inCommit', function() {
  57. let wrapper = shallow(
  58. <ResolutionBox
  59. statusDetails={{
  60. inCommit: TestStubs.Commit(),
  61. }}
  62. params={{orgId: 'org', projectId: 'project'}}
  63. />
  64. );
  65. expect(wrapper).toMatchSnapshot();
  66. });
  67. });
  68. });