debian-mirror-gitlab/spec/frontend/work_items/mock_data.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

1125 lines
27 KiB
JavaScript
Raw Normal View History

2022-08-13 15:12:31 +05:30
export const mockAssignees = [
{
__typename: 'UserCore',
id: 'gid://gitlab/User/1',
avatarUrl: '',
webUrl: '',
name: 'John Doe',
username: 'doe_I',
},
{
__typename: 'UserCore',
id: 'gid://gitlab/User/2',
avatarUrl: '',
webUrl: '',
name: 'Marcus Rutherford',
username: 'ruthfull',
},
];
2022-11-25 23:54:43 +05:30
export const mockLabels = [
{
__typename: 'Label',
id: 'gid://gitlab/Label/1',
title: 'Label 1',
description: '',
color: '#f00',
textColor: '#00f',
},
{
__typename: 'Label',
id: 'gid://gitlab/Label/2',
title: 'Label::2',
description: '',
color: '#b00',
textColor: '#00b',
},
];
2021-12-11 22:18:48 +05:30
export const workItemQueryResponse = {
2022-06-21 17:19:12 +05:30
data: {
workItem: {
__typename: 'WorkItem',
id: 'gid://gitlab/WorkItem/1',
title: 'Test',
2022-07-16 23:28:13 +05:30
state: 'OPEN',
description: 'description',
2022-08-27 11:52:29 +05:30
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-06-21 17:19:12 +05:30
workItemType: {
__typename: 'WorkItemType',
id: 'gid://gitlab/WorkItems::Type/5',
name: 'Task',
2022-08-27 11:52:29 +05:30
iconName: 'issue-type-task',
2022-06-21 17:19:12 +05:30
},
2022-07-16 23:28:13 +05:30
userPermissions: {
deleteWorkItem: false,
updateWorkItem: false,
},
2022-07-23 23:45:48 +05:30
widgets: [
{
__typename: 'WorkItemWidgetDescription',
type: 'DESCRIPTION',
description: 'some **great** text',
descriptionHtml:
'<p data-sourcepos="1:1-1:19" dir="auto">some <strong>great</strong> text</p>',
2022-11-25 23:54:43 +05:30
lastEditedAt: null,
lastEditedBy: null,
2022-07-23 23:45:48 +05:30
},
2022-08-13 15:12:31 +05:30
{
__typename: 'WorkItemWidgetAssignees',
type: 'ASSIGNEES',
allowsMultipleAssignees: true,
2022-08-27 11:52:29 +05:30
canInviteMembers: true,
2022-08-13 15:12:31 +05:30
assignees: {
nodes: mockAssignees,
},
},
{
__typename: 'WorkItemWidgetHierarchy',
type: 'HIERARCHY',
parent: {
id: 'gid://gitlab/Issue/1',
iid: '5',
title: 'Parent title',
2022-08-27 11:52:29 +05:30
confidential: false,
2022-08-13 15:12:31 +05:30
},
children: {
2022-08-27 11:52:29 +05:30
nodes: [
2022-08-13 15:12:31 +05:30
{
2022-08-27 11:52:29 +05:30
id: 'gid://gitlab/WorkItem/444',
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-08-13 15:12:31 +05:30
},
],
},
},
2022-07-23 23:45:48 +05:30
],
2021-12-11 22:18:48 +05:30
},
},
};
2022-01-26 12:08:38 +05:30
export const updateWorkItemMutationResponse = {
2022-05-07 20:08:51 +05:30
data: {
workItemUpdate: {
2022-06-21 17:19:12 +05:30
__typename: 'WorkItemUpdatePayload',
2022-08-27 11:52:29 +05:30
errors: [],
2022-05-07 20:08:51 +05:30
workItem: {
2022-06-21 17:19:12 +05:30
__typename: 'WorkItem',
id: 'gid://gitlab/WorkItem/1',
2022-05-07 20:08:51 +05:30
title: 'Updated title',
2022-07-16 23:28:13 +05:30
state: 'OPEN',
description: 'description',
2022-08-27 11:52:29 +05:30
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-05-07 20:08:51 +05:30
workItemType: {
__typename: 'WorkItemType',
2022-06-21 17:19:12 +05:30
id: 'gid://gitlab/WorkItems::Type/5',
name: 'Task',
2022-08-27 11:52:29 +05:30
iconName: 'issue-type-task',
2022-05-07 20:08:51 +05:30
},
2022-07-16 23:28:13 +05:30
userPermissions: {
deleteWorkItem: false,
updateWorkItem: false,
},
2022-08-13 15:12:31 +05:30
widgets: [
{
children: {
2022-08-27 11:52:29 +05:30
nodes: [
2022-08-13 15:12:31 +05:30
{
2022-08-27 11:52:29 +05:30
id: 'gid://gitlab/WorkItem/444',
2022-08-13 15:12:31 +05:30
},
],
},
},
2022-08-27 11:52:29 +05:30
{
__typename: 'WorkItemWidgetAssignees',
type: 'ASSIGNEES',
allowsMultipleAssignees: true,
canInviteMembers: true,
assignees: {
nodes: [mockAssignees[0]],
},
},
2022-08-13 15:12:31 +05:30
],
2022-05-07 20:08:51 +05:30
},
2022-01-26 12:08:38 +05:30
},
},
};
2022-04-04 11:22:00 +05:30
2022-10-11 01:57:18 +05:30
export const updateWorkItemMutationErrorResponse = {
data: {
workItemUpdate: {
__typename: 'WorkItemUpdatePayload',
errors: ['Error!'],
workItem: {},
},
},
};
2022-08-27 11:52:29 +05:30
export const mockParent = {
parent: {
id: 'gid://gitlab/Issue/1',
iid: '5',
title: 'Parent title',
confidential: false,
},
};
2022-08-13 15:12:31 +05:30
export const workItemResponseFactory = ({
canUpdate = false,
2022-08-27 11:52:29 +05:30
canDelete = false,
2022-08-13 15:12:31 +05:30
allowsMultipleAssignees = true,
assigneesWidgetPresent = true,
2022-10-11 01:57:18 +05:30
datesWidgetPresent = true,
2022-11-25 23:54:43 +05:30
labelsWidgetPresent = true,
2022-08-27 11:52:29 +05:30
weightWidgetPresent = true,
2022-11-25 23:54:43 +05:30
milestoneWidgetPresent = true,
iterationWidgetPresent = true,
2022-08-27 11:52:29 +05:30
confidential = false,
canInviteMembers = false,
2022-11-25 23:54:43 +05:30
allowsScopedLabels = false,
lastEditedAt = null,
lastEditedBy = null,
2022-08-27 11:52:29 +05:30
parent = mockParent.parent,
2022-08-13 15:12:31 +05:30
} = {}) => ({
2022-07-23 23:45:48 +05:30
data: {
workItem: {
__typename: 'WorkItem',
id: 'gid://gitlab/WorkItem/1',
title: 'Updated title',
state: 'OPEN',
description: 'description',
2022-08-27 11:52:29 +05:30
confidential,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-07-23 23:45:48 +05:30
workItemType: {
__typename: 'WorkItemType',
id: 'gid://gitlab/WorkItems::Type/5',
name: 'Task',
2022-08-27 11:52:29 +05:30
iconName: 'issue-type-task',
2022-07-23 23:45:48 +05:30
},
userPermissions: {
2022-08-27 11:52:29 +05:30
deleteWorkItem: canDelete,
2022-07-23 23:45:48 +05:30
updateWorkItem: canUpdate,
},
widgets: [
{
__typename: 'WorkItemWidgetDescription',
type: 'DESCRIPTION',
description: 'some **great** text',
descriptionHtml:
'<p data-sourcepos="1:1-1:19" dir="auto">some <strong>great</strong> text</p>',
2022-11-25 23:54:43 +05:30
lastEditedAt,
lastEditedBy,
2022-07-23 23:45:48 +05:30
},
2022-08-13 15:12:31 +05:30
assigneesWidgetPresent
? {
__typename: 'WorkItemWidgetAssignees',
type: 'ASSIGNEES',
allowsMultipleAssignees,
2022-08-27 11:52:29 +05:30
canInviteMembers,
2022-08-13 15:12:31 +05:30
assignees: {
nodes: mockAssignees,
},
}
: { type: 'MOCK TYPE' },
2022-11-25 23:54:43 +05:30
labelsWidgetPresent
? {
__typename: 'WorkItemWidgetLabels',
type: 'LABELS',
allowsScopedLabels,
labels: {
nodes: mockLabels,
},
}
: { type: 'MOCK TYPE' },
2022-10-11 01:57:18 +05:30
datesWidgetPresent
? {
__typename: 'WorkItemWidgetStartAndDueDate',
type: 'START_AND_DUE_DATE',
dueDate: '2022-12-31',
startDate: '2022-01-01',
}
: { type: 'MOCK TYPE' },
2022-08-27 11:52:29 +05:30
weightWidgetPresent
? {
__typename: 'WorkItemWidgetWeight',
type: 'WEIGHT',
weight: 0,
}
: { type: 'MOCK TYPE' },
2022-11-25 23:54:43 +05:30
iterationWidgetPresent
? {
__typename: 'WorkItemWidgetIteration',
type: 'ITERATION',
iteration: {
description: null,
id: 'gid://gitlab/Iteration/1215',
iid: '182',
title: 'Iteration default title',
startDate: '2022-09-22',
dueDate: '2022-09-30',
},
}
: { type: 'MOCK TYPE' },
milestoneWidgetPresent
? {
__typename: 'WorkItemWidgetMilestone',
dueDate: null,
expired: false,
id: 'gid://gitlab/Milestone/30',
title: 'v4.0',
type: 'MILESTONE',
}
: { type: 'MOCK TYPE' },
2022-08-13 15:12:31 +05:30
{
__typename: 'WorkItemWidgetHierarchy',
type: 'HIERARCHY',
children: {
2022-08-27 11:52:29 +05:30
nodes: [
2022-08-13 15:12:31 +05:30
{
2022-08-27 11:52:29 +05:30
id: 'gid://gitlab/WorkItem/444',
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-08-13 15:12:31 +05:30
},
],
},
parent,
},
2022-07-23 23:45:48 +05:30
],
},
},
});
2022-04-04 11:22:00 +05:30
export const projectWorkItemTypesQueryResponse = {
data: {
workspace: {
2022-06-21 17:19:12 +05:30
id: 'gid://gitlab/WorkItem/1',
2022-04-04 11:22:00 +05:30
workItemTypes: {
nodes: [
2022-06-21 17:19:12 +05:30
{ id: 'gid://gitlab/WorkItems::Type/1', name: 'Issue' },
{ id: 'gid://gitlab/WorkItems::Type/2', name: 'Incident' },
2022-07-16 23:28:13 +05:30
{ id: 'gid://gitlab/WorkItems::Type/3', name: 'Task' },
2022-04-04 11:22:00 +05:30
],
},
},
},
};
2022-05-07 20:08:51 +05:30
export const createWorkItemMutationResponse = {
data: {
workItemCreate: {
__typename: 'WorkItemCreatePayload',
workItem: {
__typename: 'WorkItem',
2022-06-21 17:19:12 +05:30
id: 'gid://gitlab/WorkItem/1',
2022-05-07 20:08:51 +05:30
title: 'Updated title',
2022-07-16 23:28:13 +05:30
state: 'OPEN',
description: 'description',
2022-08-27 11:52:29 +05:30
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-05-07 20:08:51 +05:30
workItemType: {
__typename: 'WorkItemType',
2022-06-21 17:19:12 +05:30
id: 'gid://gitlab/WorkItems::Type/5',
name: 'Task',
2022-08-27 11:52:29 +05:30
iconName: 'issue-type-task',
2022-05-07 20:08:51 +05:30
},
2022-07-16 23:28:13 +05:30
userPermissions: {
deleteWorkItem: false,
updateWorkItem: false,
},
2022-07-23 23:45:48 +05:30
widgets: [],
2022-05-07 20:08:51 +05:30
},
2022-08-27 11:52:29 +05:30
errors: [],
2022-05-07 20:08:51 +05:30
},
},
};
2022-06-21 17:19:12 +05:30
export const createWorkItemFromTaskMutationResponse = {
data: {
workItemCreateFromTask: {
__typename: 'WorkItemCreateFromTaskPayload',
errors: [],
workItem: {
__typename: 'WorkItem',
2022-08-13 15:12:31 +05:30
description: 'New description',
id: 'gid://gitlab/WorkItem/1',
title: 'Updated title',
state: 'OPEN',
2022-08-27 11:52:29 +05:30
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-08-13 15:12:31 +05:30
workItemType: {
__typename: 'WorkItemType',
id: 'gid://gitlab/WorkItems::Type/5',
name: 'Task',
2022-08-27 11:52:29 +05:30
iconName: 'issue-type-task',
2022-08-13 15:12:31 +05:30
},
2022-07-16 23:28:13 +05:30
userPermissions: {
deleteWorkItem: false,
updateWorkItem: false,
},
2022-08-13 15:12:31 +05:30
widgets: [
{
__typename: 'WorkItemWidgetDescription',
type: 'DESCRIPTION',
description: 'New description',
descriptionHtml: '<p>New description</p>',
2022-11-25 23:54:43 +05:30
lastEditedAt: '2022-09-21T06:18:42Z',
lastEditedBy: {
name: 'Administrator',
webPath: '/root',
},
2022-08-13 15:12:31 +05:30
},
],
},
newWorkItem: {
__typename: 'WorkItem',
id: 'gid://gitlab/WorkItem/1000000',
title: 'Updated title',
state: 'OPEN',
2022-08-27 11:52:29 +05:30
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-08-13 15:12:31 +05:30
description: '',
2022-08-27 11:52:29 +05:30
confidential: false,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-08-13 15:12:31 +05:30
workItemType: {
__typename: 'WorkItemType',
id: 'gid://gitlab/WorkItems::Type/5',
name: 'Task',
2022-08-27 11:52:29 +05:30
iconName: 'issue-type-task',
2022-08-13 15:12:31 +05:30
},
userPermissions: {
deleteWorkItem: false,
updateWorkItem: false,
},
widgets: [],
2022-06-21 17:19:12 +05:30
},
},
},
};
export const deleteWorkItemResponse = {
data: { workItemDelete: { errors: [], __typename: 'WorkItemDeletePayload' } },
};
export const deleteWorkItemFailureResponse = {
data: { workItemDelete: null },
errors: [
{
message:
"The resource that you are attempting to access does not exist or you don't have permission to perform this action",
locations: [{ line: 2, column: 3 }],
path: ['workItemDelete'],
},
],
};
2022-08-27 11:52:29 +05:30
export const deleteWorkItemMutationErrorResponse = {
data: {
workItemDelete: {
errors: ['Error'],
},
},
};
export const deleteWorkItemFromTaskMutationResponse = {
data: {
workItemDeleteTask: {
workItem: { id: 123, descriptionHtml: 'updated work item desc' },
errors: [],
},
},
};
export const deleteWorkItemFromTaskMutationErrorResponse = {
data: {
workItemDeleteTask: {
workItem: { id: 123, descriptionHtml: 'updated work item desc' },
errors: ['Error'],
},
},
};
2022-10-11 01:57:18 +05:30
export const workItemDatesSubscriptionResponse = {
data: {
issuableDatesUpdated: {
id: 'gid://gitlab/WorkItem/1',
widgets: [
{
__typename: 'WorkItemWidgetStartAndDueDate',
dueDate: '2022-12-31',
startDate: '2022-01-01',
},
],
},
},
};
2022-06-21 17:19:12 +05:30
export const workItemTitleSubscriptionResponse = {
data: {
issuableTitleUpdated: {
id: 'gid://gitlab/WorkItem/1',
title: 'new title',
},
},
};
2022-07-23 23:45:48 +05:30
2022-10-11 01:57:18 +05:30
export const workItemWeightSubscriptionResponse = {
data: {
issuableWeightUpdated: {
id: 'gid://gitlab/WorkItem/1',
widgets: [
{
__typename: 'WorkItemWidgetWeight',
weight: 1,
},
],
},
},
};
2022-11-25 23:54:43 +05:30
export const workItemAssigneesSubscriptionResponse = {
data: {
issuableAssigneesUpdated: {
id: 'gid://gitlab/WorkItem/1',
widgets: [
{
__typename: 'WorkItemAssigneesWeight',
assignees: {
nodes: [mockAssignees[0]],
},
},
],
},
},
};
export const workItemLabelsSubscriptionResponse = {
data: {
issuableLabelsUpdated: {
id: 'gid://gitlab/WorkItem/1',
widgets: [
{
__typename: 'WorkItemWidgetLabels',
type: 'LABELS',
allowsScopedLabels: false,
labels: {
nodes: mockLabels,
},
},
],
},
},
};
export const workItemIterationSubscriptionResponse = {
data: {
issuableIterationUpdated: {
id: 'gid://gitlab/WorkItem/1',
widgets: [
{
__typename: 'WorkItemWidgetIteration',
iteration: {
description: 'Iteration description',
dueDate: '2022-07-29',
id: 'gid://gitlab/Iteration/1125',
iid: '95',
startDate: '2022-06-22',
title: 'Iteration subcription title',
},
},
],
},
},
};
2022-07-23 23:45:48 +05:30
export const workItemHierarchyEmptyResponse = {
data: {
workItem: {
id: 'gid://gitlab/WorkItem/1',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/6',
__typename: 'WorkItemType',
},
title: 'New title',
2022-08-27 11:52:29 +05:30
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-08-27 11:52:29 +05:30
userPermissions: {
deleteWorkItem: false,
updateWorkItem: false,
},
confidential: false,
2022-07-23 23:45:48 +05:30
widgets: [
{
type: 'DESCRIPTION',
__typename: 'WorkItemWidgetDescription',
},
{
type: 'HIERARCHY',
parent: null,
children: {
nodes: [],
__typename: 'WorkItemConnection',
},
__typename: 'WorkItemWidgetHierarchy',
},
],
__typename: 'WorkItem',
},
},
};
2022-08-27 11:52:29 +05:30
export const workItemHierarchyNoUpdatePermissionResponse = {
data: {
workItem: {
id: 'gid://gitlab/WorkItem/1',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/6',
__typename: 'WorkItemType',
},
title: 'New title',
userPermissions: {
deleteWorkItem: false,
updateWorkItem: false,
},
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-08-27 11:52:29 +05:30
confidential: false,
widgets: [
{
type: 'DESCRIPTION',
__typename: 'WorkItemWidgetDescription',
},
{
type: 'HIERARCHY',
parent: null,
children: {
nodes: [
{
id: 'gid://gitlab/WorkItem/2',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/5',
__typename: 'WorkItemType',
},
title: 'xyz',
state: 'OPEN',
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
__typename: 'WorkItem',
},
],
__typename: 'WorkItemConnection',
},
__typename: 'WorkItemWidgetHierarchy',
},
],
__typename: 'WorkItem',
},
},
};
2022-10-11 01:57:18 +05:30
export const workItemTask = {
id: 'gid://gitlab/WorkItem/4',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/5',
__typename: 'WorkItemType',
},
title: 'bar',
state: 'OPEN',
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
__typename: 'WorkItem',
};
export const confidentialWorkItemTask = {
id: 'gid://gitlab/WorkItem/2',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/5',
__typename: 'WorkItemType',
},
title: 'xyz',
state: 'OPEN',
confidential: true,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
__typename: 'WorkItem',
};
export const closedWorkItemTask = {
id: 'gid://gitlab/WorkItem/3',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/5',
__typename: 'WorkItemType',
},
title: 'abc',
state: 'CLOSED',
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: '2022-08-12T13:07:52Z',
__typename: 'WorkItem',
};
2022-07-23 23:45:48 +05:30
export const workItemHierarchyResponse = {
data: {
workItem: {
id: 'gid://gitlab/WorkItem/1',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/6',
__typename: 'WorkItemType',
},
title: 'New title',
2022-08-27 11:52:29 +05:30
userPermissions: {
deleteWorkItem: true,
updateWorkItem: true,
},
confidential: false,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-07-23 23:45:48 +05:30
widgets: [
{
type: 'DESCRIPTION',
__typename: 'WorkItemWidgetDescription',
},
{
type: 'HIERARCHY',
parent: null,
children: {
nodes: [
2022-10-11 01:57:18 +05:30
confidentialWorkItemTask,
closedWorkItemTask,
workItemTask,
2022-07-23 23:45:48 +05:30
{
id: 'gid://gitlab/WorkItem/5',
workItemType: {
id: 'gid://gitlab/WorkItems::Type/5',
__typename: 'WorkItemType',
},
title: 'foobar',
state: 'OPEN',
2022-08-27 11:52:29 +05:30
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-07-23 23:45:48 +05:30
__typename: 'WorkItem',
},
],
__typename: 'WorkItemConnection',
},
__typename: 'WorkItemWidgetHierarchy',
},
],
__typename: 'WorkItem',
},
},
};
2022-08-13 15:12:31 +05:30
export const changeWorkItemParentMutationResponse = {
data: {
workItemUpdate: {
workItem: {
2022-08-27 11:52:29 +05:30
__typename: 'WorkItem',
2022-08-13 15:12:31 +05:30
workItemType: {
__typename: 'WorkItemType',
2022-08-27 11:52:29 +05:30
id: 'gid://gitlab/WorkItems::Type/1',
name: 'Issue',
iconName: 'issue-type-issue',
2022-08-13 15:12:31 +05:30
},
2022-08-27 11:52:29 +05:30
userPermissions: {
deleteWorkItem: true,
updateWorkItem: true,
},
description: null,
id: 'gid://gitlab/WorkItem/2',
2022-08-13 15:12:31 +05:30
state: 'OPEN',
2022-08-27 11:52:29 +05:30
title: 'Foo',
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
closedAt: null,
2022-10-11 01:57:18 +05:30
project: {
__typename: 'Project',
id: '1',
fullPath: 'test-project-path',
},
2022-08-27 11:52:29 +05:30
widgets: [
{
__typename: 'WorkItemWidgetHierarchy',
type: 'HIERARCHY',
parent: null,
children: {
nodes: [],
},
},
],
2022-08-13 15:12:31 +05:30
},
errors: [],
__typename: 'WorkItemUpdatePayload',
},
},
};
export const availableWorkItemsResponse = {
data: {
workspace: {
__typename: 'Project',
id: 'gid://gitlab/Project/2',
workItems: {
edges: [
{
node: {
id: 'gid://gitlab/WorkItem/458',
title: 'Task 1',
state: 'OPEN',
2022-08-27 11:52:29 +05:30
createdAt: '2022-08-03T12:41:54Z',
2022-08-13 15:12:31 +05:30
},
},
{
node: {
id: 'gid://gitlab/WorkItem/459',
title: 'Task 2',
state: 'OPEN',
2022-08-27 11:52:29 +05:30
createdAt: '2022-08-03T12:41:54Z',
2022-08-13 15:12:31 +05:30
},
},
],
},
},
},
};
export const projectMembersResponseWithCurrentUser = {
data: {
workspace: {
id: '1',
__typename: 'Project',
users: {
nodes: [
{
id: 'user-2',
user: {
__typename: 'UserCore',
id: 'gid://gitlab/User/5',
avatarUrl: '/avatar2',
name: 'rookie',
username: 'rookie',
webUrl: 'rookie',
status: null,
},
},
{
id: 'user-1',
user: {
__typename: 'UserCore',
id: 'gid://gitlab/User/1',
avatarUrl:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon',
name: 'Administrator',
username: 'root',
webUrl: '/root',
status: null,
},
},
],
2022-10-11 01:57:18 +05:30
pageInfo: {
hasNextPage: false,
endCursor: null,
startCursor: null,
},
},
},
},
};
export const projectMembersResponseWithCurrentUserWithNextPage = {
data: {
workspace: {
id: '1',
__typename: 'Project',
users: {
nodes: [
{
id: 'user-2',
user: {
__typename: 'UserCore',
id: 'gid://gitlab/User/5',
avatarUrl: '/avatar2',
name: 'rookie',
username: 'rookie',
webUrl: 'rookie',
status: null,
},
},
{
id: 'user-1',
user: {
__typename: 'UserCore',
id: 'gid://gitlab/User/1',
avatarUrl:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon',
name: 'Administrator',
username: 'root',
webUrl: '/root',
status: null,
},
},
],
pageInfo: {
hasNextPage: true,
endCursor: 'endCursor',
startCursor: 'startCursor',
},
},
},
},
};
export const projectMembersResponseWithNoMatchingUsers = {
data: {
workspace: {
id: '1',
__typename: 'Project',
users: {
nodes: [],
pageInfo: {
endCursor: null,
hasNextPage: false,
startCursor: null,
},
2022-08-13 15:12:31 +05:30
},
},
},
};
export const projectMembersResponseWithoutCurrentUser = {
data: {
workspace: {
id: '1',
__typename: 'Project',
users: {
nodes: [
{
id: 'user-2',
user: {
__typename: 'UserCore',
id: 'gid://gitlab/User/5',
avatarUrl: '/avatar2',
name: 'rookie',
username: 'rookie',
webUrl: 'rookie',
status: null,
},
},
],
},
},
},
};
export const currentUserResponse = {
data: {
currentUser: {
__typename: 'UserCore',
id: 'gid://gitlab/User/1',
avatarUrl:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon',
name: 'Administrator',
username: 'root',
webUrl: '/root',
},
},
};
export const currentUserNullResponse = {
data: {
currentUser: null,
},
};
export const projectLabelsResponse = {
data: {
workspace: {
id: '1',
__typename: 'Project',
labels: {
nodes: mockLabels,
},
},
},
};
2022-11-25 23:54:43 +05:30
export const mockIterationWidgetResponse = {
description: 'Iteration description',
dueDate: '2022-07-19',
id: 'gid://gitlab/Iteration/1124',
iid: '91',
startDate: '2022-06-22',
title: 'Iteration title widget',
};
export const groupIterationsResponse = {
data: {
workspace: {
id: 'gid://gitlab/Group/22',
attributes: {
nodes: [
{
id: 'gid://gitlab/Iteration/1124',
title: null,
startDate: '2022-06-22',
dueDate: '2022-07-19',
webUrl: 'http://127.0.0.1:3000/groups/gitlab-org/-/iterations/1124',
iterationCadence: {
id: 'gid://gitlab/Iterations::Cadence/1101',
title: 'Quod voluptates quidem ea eaque eligendi ex corporis.',
__typename: 'IterationCadence',
},
__typename: 'Iteration',
state: 'current',
},
{
id: 'gid://gitlab/Iteration/1185',
title: null,
startDate: '2022-07-06',
dueDate: '2022-07-19',
webUrl: 'http://127.0.0.1:3000/groups/gitlab-org/-/iterations/1185',
iterationCadence: {
id: 'gid://gitlab/Iterations::Cadence/1144',
title: 'Quo velit perspiciatis saepe aut omnis voluptas ab eos.',
__typename: 'IterationCadence',
},
__typename: 'Iteration',
state: 'current',
},
{
id: 'gid://gitlab/Iteration/1194',
title: null,
startDate: '2022-07-06',
dueDate: '2022-07-19',
webUrl: 'http://127.0.0.1:3000/groups/gitlab-org/-/iterations/1194',
iterationCadence: {
id: 'gid://gitlab/Iterations::Cadence/1152',
title:
'Minima aut consequatur magnam vero doloremque accusamus maxime repellat voluptatem qui.',
__typename: 'IterationCadence',
},
__typename: 'Iteration',
state: 'current',
},
],
__typename: 'IterationConnection',
},
__typename: 'Group',
},
},
};
export const groupIterationsResponseWithNoIterations = {
data: {
workspace: {
id: 'gid://gitlab/Group/22',
attributes: {
nodes: [],
__typename: 'IterationConnection',
},
__typename: 'Group',
},
},
};
export const mockMilestoneWidgetResponse = {
dueDate: null,
expired: false,
id: 'gid://gitlab/Milestone/30',
title: 'v4.0',
};
export const projectMilestonesResponse = {
data: {
workspace: {
id: 'gid://gitlab/Project/1',
attributes: {
nodes: [
{
id: 'gid://gitlab/Milestone/5',
title: 'v4.0',
webUrl: '/gitlab-org/gitlab-test/-/milestones/5',
dueDate: null,
expired: false,
__typename: 'Milestone',
state: 'active',
},
{
id: 'gid://gitlab/Milestone/4',
title: 'v3.0',
webUrl: '/gitlab-org/gitlab-test/-/milestones/4',
dueDate: null,
expired: false,
__typename: 'Milestone',
state: 'active',
},
],
__typename: 'MilestoneConnection',
},
__typename: 'Project',
},
},
};
export const projectMilestonesResponseWithNoMilestones = {
data: {
workspace: {
id: 'gid://gitlab/Project/1',
attributes: {
nodes: [],
__typename: 'MilestoneConnection',
},
__typename: 'Project',
},
},
};