issues.spec.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import {GroupStatus} from 'sentry/types';
  2. import {transformIssuesResponseToTable} from 'sentry/views/dashboards/datasetConfig/issues';
  3. describe('transformIssuesResponseToTable', function () {
  4. it('transforms issues response', () => {
  5. expect(
  6. transformIssuesResponseToTable(
  7. [
  8. TestStubs.Group({
  9. id: '1',
  10. title: 'Error: Failed',
  11. project: TestStubs.Project({
  12. id: '3',
  13. }),
  14. status: GroupStatus.UNRESOLVED,
  15. owners: [
  16. {
  17. type: 'ownershipRule',
  18. owner: 'user:2',
  19. date_added: '2022-01-01T13:04:02Z',
  20. },
  21. ],
  22. lifetime: {count: '10', firstSeen: '', lastSeen: '', stats: {}, userCount: 5},
  23. count: '6',
  24. userCount: 3,
  25. firstSeen: '2022-01-01T13:04:02Z',
  26. }),
  27. ],
  28. {
  29. name: '',
  30. fields: ['issue', 'assignee', 'title', 'culprit', 'status'],
  31. columns: ['issue', 'assignee', 'title', 'culprit', 'status'],
  32. aggregates: [],
  33. conditions: 'assigned_or_suggested:#visibility timesSeen:>100',
  34. orderby: '',
  35. },
  36. TestStubs.Organization(),
  37. TestStubs.GlobalSelection()
  38. )
  39. ).toEqual(
  40. expect.objectContaining({
  41. data: [
  42. expect.objectContaining({
  43. discoverSearchQuery: ' assigned_or_suggested:#visibility timesSeen:>100',
  44. events: '6',
  45. firstSeen: '2022-01-01T13:04:02Z',
  46. id: '1',
  47. 'issue.id': '1',
  48. lifetimeUsers: 5,
  49. links: '',
  50. period: '',
  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. });
  62. });