issues.spec.jsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import {transformIssuesResponseToTable} from 'sentry/views/dashboards/datasetConfig/issues';
  2. describe('transformIssuesResponseToTable', function () {
  3. it('transforms issues response', () => {
  4. expect(
  5. transformIssuesResponseToTable(
  6. [
  7. {
  8. id: '1',
  9. title: 'Error: Failed',
  10. project: {
  11. id: '3',
  12. },
  13. status: 'unresolved',
  14. owners: [
  15. {
  16. type: 'ownershipRule',
  17. owner: 'user:2',
  18. },
  19. ],
  20. lifetime: {count: 10, userCount: 5},
  21. count: 6,
  22. userCount: 3,
  23. firstSeen: '2022-01-01T13:04:02Z',
  24. },
  25. ],
  26. {
  27. name: '',
  28. fields: ['issue', 'assignee', 'title', 'culprit', 'status'],
  29. columns: ['issue', 'assignee', 'title', 'culprit', 'status'],
  30. aggregates: [],
  31. conditions: 'assigned_or_suggested:#visibility timesSeen:>100',
  32. orderby: '',
  33. },
  34. TestStubs.Organization(),
  35. TestStubs.GlobalSelection()
  36. )
  37. ).toEqual({
  38. data: [
  39. {
  40. discoverSearchQuery: ' assigned_or_suggested:#visibility timesSeen:>100',
  41. events: 6,
  42. firstSeen: '2022-01-01T13:04:02Z',
  43. id: '1',
  44. issue: undefined,
  45. 'issue.id': '1',
  46. lifetimeEvents: 10,
  47. lifetimeUsers: 5,
  48. links: undefined,
  49. period: '',
  50. project: undefined,
  51. projectId: '3',
  52. status: 'unresolved',
  53. title: 'Error: Failed',
  54. users: 3,
  55. end: '2019-09-09T11:18:59',
  56. start: '2019-10-09T11:18:59',
  57. },
  58. ],
  59. });
  60. });
  61. });