resolutionBox.spec.jsx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. orgId={'org'}
  11. projectId={'project'}
  12. />
  13. );
  14. expect(wrapper).toMatchSnapshot();
  15. });
  16. it('handles inNextRelease with actor', function() {
  17. let wrapper = shallow(
  18. <ResolutionBox
  19. statusDetails={{
  20. inNextRelease: true,
  21. actor: {id: '111', name: 'David Cramer', email: 'david@sentry.io'},
  22. }}
  23. orgId={'org'}
  24. projectId={'project'}
  25. />
  26. );
  27. expect(wrapper).toMatchSnapshot();
  28. });
  29. it('handles inRelease', function() {
  30. let wrapper = shallow(
  31. <ResolutionBox
  32. statusDetails={{
  33. inRelease: '1.0',
  34. }}
  35. orgId={'org'}
  36. projectId={'project'}
  37. />
  38. );
  39. expect(wrapper).toMatchSnapshot();
  40. });
  41. it('handles inRelease with actor', function() {
  42. let wrapper = shallow(
  43. <ResolutionBox
  44. statusDetails={{
  45. inRelease: '1.0',
  46. actor: {id: '111', name: 'David Cramer', email: 'david@sentry.io'},
  47. }}
  48. orgId={'org'}
  49. projectId={'project'}
  50. />
  51. );
  52. expect(wrapper).toMatchSnapshot();
  53. });
  54. it('handles default', function() {
  55. let wrapper = shallow(
  56. <ResolutionBox statusDetails={{}} orgId={'org'} projectId={'project'} />
  57. );
  58. expect(wrapper).toMatchSnapshot();
  59. });
  60. it('handles inCommit', function() {
  61. let wrapper = shallow(
  62. <ResolutionBox
  63. statusDetails={{
  64. inCommit: TestStubs.Commit(),
  65. }}
  66. orgId={'org'}
  67. projectId={'project'}
  68. />
  69. );
  70. expect(wrapper).toMatchSnapshot();
  71. });
  72. });
  73. });