Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mock_data.js « incidents « components « show « issues « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 75c0a7350ae764edf039c91f3390ba8f2c3024a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
export const mockEvents = [
  {
    action: 'comment',
    author: {
      __typename: 'UserCore',
      id: 'gid://gitlab/User/1',
      name: 'Administrator',
      username: 'root',
    },
    createdAt: '2022-03-22T15:59:08Z',
    id: 'gid://gitlab/IncidentManagement::TimelineEvent/132',
    note: 'Dummy event 1',
    noteHtml: '<p>Dummy event 1</p>',
    occurredAt: '2022-03-22T15:59:00Z',
    updatedAt: '2022-03-22T15:59:08Z',
    __typename: 'TimelineEventType',
  },
  {
    action: 'comment',
    author: {
      __typename: 'UserCore',
      id: 'gid://gitlab/User/1',
      name: 'Administrator',
      username: 'root',
    },
    createdAt: '2022-03-23T14:57:08Z',
    id: 'gid://gitlab/IncidentManagement::TimelineEvent/131',
    note: 'Dummy event 2',
    noteHtml: '<p>Dummy event 2</p>',
    occurredAt: '2022-03-23T14:57:00Z',
    updatedAt: '2022-03-23T14:57:08Z',
    __typename: 'TimelineEventType',
  },
  {
    action: 'comment',
    author: {
      __typename: 'UserCore',
      id: 'gid://gitlab/User/1',
      name: 'Administrator',
      username: 'root',
    },
    createdAt: '2022-03-23T15:59:08Z',
    id: 'gid://gitlab/IncidentManagement::TimelineEvent/132',
    note: 'Dummy event 3',
    noteHtml: '<p>Dummy event 3</p>',
    occurredAt: '2022-03-23T15:59:00Z',
    updatedAt: '2022-03-23T15:59:08Z',
    __typename: 'TimelineEventType',
  },
];

export const timelineEventsQueryListResponse = {
  data: {
    project: {
      id: 'gid://gitlab/Project/8',
      incidentManagementTimelineEvents: {
        nodes: mockEvents,
      },
    },
  },
};

export const timelineEventsQueryEmptyResponse = {
  data: {
    project: {
      id: 'gid://gitlab/Project/8',
      incidentManagementTimelineEvents: {
        nodes: [],
      },
    },
  },
};

export const timelineEventsCreateEventResponse = {
  data: {
    timelineEventCreate: {
      timelineEvent: {
        ...mockEvents[0],
      },
      errors: [],
    },
  },
};

export const timelineEventsCreateEventError = {
  data: {
    timelineEventCreate: {
      timelineEvent: {
        ...mockEvents[0],
      },
      errors: ['Create error'],
    },
  },
};

const timelineEventDeleteData = (errors = []) => {
  return {
    data: {
      timelineEventDestroy: {
        timelineEvent: { ...mockEvents[0] },
        errors,
      },
    },
  };
};

export const timelineEventsDeleteEventResponse = timelineEventDeleteData();

export const timelineEventsDeleteEventError = timelineEventDeleteData(['Item does not exist']);

export const mockGetTimelineData = {
  project: {
    id: 'gid://gitlab/Project/19',
    incidentManagementTimelineEvents: {
      nodes: [
        {
          id: 'gid://gitlab/IncidentManagement::TimelineEvent/8',
          note: 'another one2',
          noteHtml: '<p>another one2</p>',
          action: 'comment',
          occurredAt: '2022-07-01T12:47:00Z',
          createdAt: '2022-07-20T12:47:40Z',
        },
      ],
    },
  },
};