eventOrGroupExtraDetails.spec.jsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import {initializeOrg} from 'sentry-test/initializeOrg';
  2. import {render} from 'sentry-test/reactTestingLibrary';
  3. import EventOrGroupExtraDetails from 'sentry/components/eventOrGroupExtraDetails';
  4. describe('EventOrGroupExtraDetails', function () {
  5. const {routerContext} = initializeOrg();
  6. it('renders last and first seen', function () {
  7. const {container} = render(
  8. <EventOrGroupExtraDetails
  9. data={{
  10. orgId: 'orgId',
  11. projectId: 'projectId',
  12. groupId: 'groupId',
  13. lastSeen: '2017-07-25T22:56:12Z',
  14. firstSeen: '2017-07-01T02:06:02Z',
  15. }}
  16. />,
  17. {context: routerContext}
  18. );
  19. expect(container).toSnapshot();
  20. });
  21. it('renders only first seen', function () {
  22. const {container} = render(
  23. <EventOrGroupExtraDetails
  24. data={{
  25. orgId: 'orgId',
  26. projectId: 'projectId',
  27. groupId: 'groupId',
  28. firstSeen: '2017-07-01T02:06:02Z',
  29. }}
  30. />,
  31. {context: routerContext}
  32. );
  33. expect(container).toSnapshot();
  34. });
  35. it('renders only last seen', function () {
  36. const {container} = render(
  37. <EventOrGroupExtraDetails
  38. data={{
  39. orgId: 'orgId',
  40. projectId: 'projectId',
  41. groupId: 'groupId',
  42. lastSeen: '2017-07-25T22:56:12Z',
  43. }}
  44. />,
  45. {context: routerContext}
  46. );
  47. expect(container).toSnapshot();
  48. });
  49. it('renders all details', function () {
  50. const {container} = render(
  51. <EventOrGroupExtraDetails
  52. data={{
  53. orgId: 'orgId',
  54. projectId: 'projectId',
  55. groupId: 'groupId',
  56. lastSeen: '2017-07-25T22:56:12Z',
  57. firstSeen: '2017-07-01T02:06:02Z',
  58. numComments: 14,
  59. shortId: 'shortId',
  60. logger: 'javascript logger',
  61. annotations: ['annotation1', 'annotation2'],
  62. assignedTo: {
  63. name: 'Assignee Name',
  64. },
  65. status: 'resolved',
  66. }}
  67. />,
  68. {context: routerContext}
  69. );
  70. expect(container).toSnapshot();
  71. });
  72. it('renders assignee and status', function () {
  73. const {container} = render(
  74. <EventOrGroupExtraDetails
  75. data={{
  76. orgId: 'orgId',
  77. projectId: 'projectId',
  78. groupId: 'groupId',
  79. lastSeen: '2017-07-25T22:56:12Z',
  80. firstSeen: '2017-07-01T02:06:02Z',
  81. numComments: 14,
  82. shortId: 'shortId',
  83. logger: 'javascript logger',
  84. annotations: ['annotation1', 'annotation2'],
  85. assignedTo: {
  86. name: 'Assignee Name',
  87. },
  88. status: 'resolved',
  89. showStatus: true,
  90. }}
  91. showAssignee
  92. />,
  93. {context: routerContext}
  94. );
  95. expect(container).toSnapshot();
  96. });
  97. it('details when mentioned', function () {
  98. const {container} = render(
  99. <EventOrGroupExtraDetails
  100. data={{
  101. orgId: 'orgId',
  102. projectId: 'projectId',
  103. groupId: 'groupId',
  104. lastSeen: '2017-07-25T22:56:12Z',
  105. firstSeen: '2017-07-01T02:06:02Z',
  106. numComments: 14,
  107. shortId: 'shortId',
  108. logger: 'javascript logger',
  109. annotations: ['annotation1', 'annotation2'],
  110. subscriptionDetails: {reason: 'mentioned'},
  111. }}
  112. />,
  113. {context: routerContext}
  114. );
  115. expect(container).toSnapshot();
  116. });
  117. });