resolutionBox.spec.jsx 1.8 KB

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