resolutionBox.spec.jsx 1.8 KB

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