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
|
import { TEST_HOST } from 'helpers/test_constants';
function getDate(daysMinus) {
const today = new Date();
today.setDate(today.getDate() - daysMinus);
return today.toISOString();
}
export default () => ({
id: 1,
iid: 1,
state: 'opened',
upvotes: 1,
userNotesCount: 2,
closedAt: getDate(1),
createdAt: getDate(3),
updatedAt: getDate(2),
confidential: false,
webUrl: `${TEST_HOST}/test/issue/1`,
title: 'Test issue',
author: {
avatarUrl: `${TEST_HOST}/avatar`,
name: 'Author Name',
username: 'author.username',
webUrl: `${TEST_HOST}/author`,
},
});
export const mockIssueSuggestionResponse = {
data: {
project: {
id: 'gid://gitlab/Project/278964',
issues: {
edges: [
{
node: {
id: 'gid://gitlab/Issue/123725957',
iid: '696',
title: 'Remove unused MR widget extension expand success, failed, warning events',
confidential: false,
userNotesCount: 16,
upvotes: 0,
webUrl: 'https://gitlab.com/gitlab-org/gitlab/-/issues/696',
state: 'opened',
closedAt: null,
createdAt: '2023-02-15T12:29:59Z',
updatedAt: '2023-03-01T19:38:22Z',
author: {
id: 'gid://gitlab/User/325',
name: 'User Name',
username: 'user-name',
avatarUrl: '/uploads/-/system/user/avatar/325/avatar.png',
webUrl: 'https://gitlab.com/user-name',
__typename: 'UserCore',
},
__typename: 'Issue',
},
__typename: 'IssueEdge',
},
{
node: {
id: 'gid://gitlab/Issue/123',
iid: '391',
title: 'Remove unused MR widget extension expand success, failed, warning events',
confidential: false,
userNotesCount: 16,
upvotes: 0,
webUrl: 'https://gitlab.com/gitlab-org/gitlab/-/issues/391',
state: 'opened',
closedAt: null,
createdAt: '2023-02-15T12:29:59Z',
updatedAt: '2023-03-01T19:38:22Z',
author: {
id: 'gid://gitlab/User/2080',
name: 'User Name',
username: 'user-name',
avatarUrl: '/uploads/-/system/user/avatar/2080/avatar.png',
webUrl: 'https://gitlab.com/user-name',
__typename: 'UserCore',
},
__typename: 'Issue',
},
__typename: 'IssueEdge',
},
],
__typename: 'IssueConnection',
},
__typename: 'Project',
},
},
};
|