eventOrGroupExtraDetails.spec.tsx 3.0 KB

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