group.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import {ProjectFixture} from 'sentry-fixture/project';
  2. import {EventOrGroupType} from 'sentry/types/event';
  3. import {
  4. type Group,
  5. GroupStatus,
  6. GroupUnresolved,
  7. IssueCategory,
  8. IssueType,
  9. PriorityLevel,
  10. } from 'sentry/types/group';
  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. priorityLockedAt: null,
  41. project: ProjectFixture({
  42. platform: 'javascript',
  43. }),
  44. seenBy: [],
  45. shareId: '',
  46. shortId: 'JAVASCRIPT-6QS',
  47. stats: {
  48. '24h': [
  49. [1517281200, 2],
  50. [1517310000, 1],
  51. ],
  52. '30d': [
  53. [1514764800, 1],
  54. [1515024000, 122],
  55. ],
  56. },
  57. status: GroupStatus.UNRESOLVED,
  58. statusDetails: {},
  59. subscriptionDetails: null,
  60. title: 'RequestError: GET /issues/ 404',
  61. type: EventOrGroupType.ERROR,
  62. userCount: 35097,
  63. userReportCount: 0,
  64. };
  65. return {...unresolvedGroup, ...params} as Group;
  66. }