resolutionBox.spec.tsx 2.0 KB

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