debian-mirror-gitlab/spec/frontend/issues/new/mock_data.js

93 lines
2.7 KiB
JavaScript
Raw Normal View History

2021-03-08 18:12:59 +05:30
import { TEST_HOST } from 'helpers/test_constants';
2020-07-28 23:09:34 +05:30
2019-02-15 15:39:39 +05:30
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,
2020-07-28 23:09:34 +05:30
webUrl: `${TEST_HOST}/test/issue/1`,
2019-02-15 15:39:39 +05:30
title: 'Test issue',
author: {
2020-07-28 23:09:34 +05:30
avatarUrl: `${TEST_HOST}/avatar`,
2019-02-15 15:39:39 +05:30
name: 'Author Name',
username: 'author.username',
2020-07-28 23:09:34 +05:30
webUrl: `${TEST_HOST}/author`,
2019-02-15 15:39:39 +05:30
},
});
2023-05-27 22:25:52 +05:30
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',
},
},
};