resolutionBox.spec.tsx 2.1 KB

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