group.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import {ProjectFixture} from 'sentry-fixture/project';
  2. import {
  3. EventOrGroupType,
  4. type Group,
  5. GroupStatus,
  6. GroupUnresolved,
  7. IssueCategory,
  8. IssueType,
  9. PriorityLevel,
  10. } from 'sentry/types';
  11. export function GroupFixture(params: Partial<Group> = {}): Group {
  12. const unresolvedGroup: GroupUnresolved = {
  13. activity: [],
  14. annotations: [],
  15. assignedTo: null,
  16. count: '327482',
  17. culprit: 'fetchData(app/components/group/suggestedOwners/suggestedOwners)',
  18. firstSeen: '2019-04-05T19:44:05.963Z',
  19. filtered: null,
  20. hasSeen: false,
  21. id: '1',
  22. isBookmarked: false,
  23. isPublic: false,
  24. isSubscribed: false,
  25. isUnhandled: false,
  26. issueCategory: IssueCategory.ERROR,
  27. issueType: IssueType.ERROR,
  28. lastSeen: '2019-04-11T01:08:59Z',
  29. level: 'warning',
  30. logger: null,
  31. metadata: {function: 'fetchData', type: 'RequestError'},
  32. numComments: 0,
  33. participants: [],
  34. permalink: 'https://foo.io/organizations/foo/issues/1234/',
  35. platform: 'javascript',
  36. pluginActions: [],
  37. pluginContexts: [],
  38. pluginIssues: [],
  39. priority: PriorityLevel.MEDIUM,
  40. project: ProjectFixture({
  41. platform: 'javascript',
  42. }),
  43. seenBy: [],
  44. shareId: '',
  45. shortId: 'JAVASCRIPT-6QS',
  46. stats: {
  47. '24h': [
  48. [1517281200, 2],
  49. [1517310000, 1],
  50. ],
  51. '30d': [
  52. [1514764800, 1],
  53. [1515024000, 122],
  54. ],
  55. },
  56. status: GroupStatus.UNRESOLVED,
  57. statusDetails: {},
  58. subscriptionDetails: null,
  59. title: 'RequestError: GET /issues/ 404',
  60. type: EventOrGroupType.ERROR,
  61. userCount: 35097,
  62. userReportCount: 0,
  63. };
  64. return {...unresolvedGroup, ...params} as Group;
  65. }