2021-10-19 08:12:07 -04:00
|
|
|
export const workItemQueryResponse = {
|
2022-03-24 11:09:10 -04:00
|
|
|
data: {
|
|
|
|
workItem: {
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
|
|
|
title: 'Test',
|
2022-04-21 08:10:16 -04:00
|
|
|
state: 'OPEN',
|
2022-05-11 11:07:26 -04:00
|
|
|
description: 'description',
|
2022-03-24 11:09:10 -04:00
|
|
|
workItemType: {
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
|
|
|
name: 'Task',
|
|
|
|
},
|
2022-04-28 05:08:26 -04:00
|
|
|
userPermissions: {
|
|
|
|
deleteWorkItem: false,
|
|
|
|
updateWorkItem: false,
|
|
|
|
},
|
2022-05-31 05:08:17 -04:00
|
|
|
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>',
|
|
|
|
},
|
|
|
|
],
|
2021-10-19 08:12:07 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2021-12-08 07:13:04 -05:00
|
|
|
|
|
|
|
export const updateWorkItemMutationResponse = {
|
2022-03-10 01:09:00 -05:00
|
|
|
data: {
|
|
|
|
workItemUpdate: {
|
2022-03-24 11:09:10 -04:00
|
|
|
__typename: 'WorkItemUpdatePayload',
|
2022-03-10 01:09:00 -05:00
|
|
|
workItem: {
|
2022-03-24 11:09:10 -04:00
|
|
|
__typename: 'WorkItem',
|
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
2022-03-10 01:09:00 -05:00
|
|
|
title: 'Updated title',
|
2022-04-21 08:10:16 -04:00
|
|
|
state: 'OPEN',
|
2022-05-11 11:07:26 -04:00
|
|
|
description: 'description',
|
2022-03-10 01:09:00 -05:00
|
|
|
workItemType: {
|
|
|
|
__typename: 'WorkItemType',
|
2022-03-24 11:09:10 -04:00
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
2022-03-23 08:07:27 -04:00
|
|
|
name: 'Task',
|
2021-12-08 07:13:04 -05:00
|
|
|
},
|
2022-04-28 05:08:26 -04:00
|
|
|
userPermissions: {
|
|
|
|
deleteWorkItem: false,
|
|
|
|
updateWorkItem: false,
|
|
|
|
},
|
2022-05-31 05:08:17 -04:00
|
|
|
widgets: [],
|
2022-03-10 01:09:00 -05:00
|
|
|
},
|
2021-12-08 07:13:04 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-02-09 13:16:19 -05:00
|
|
|
|
2022-06-15 17:10:04 -04:00
|
|
|
export const workItemResponseFactory = ({ canUpdate } = {}) => ({
|
|
|
|
data: {
|
|
|
|
workItem: {
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
|
|
|
title: 'Updated title',
|
|
|
|
state: 'OPEN',
|
|
|
|
description: 'description',
|
|
|
|
workItemType: {
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
|
|
|
name: 'Task',
|
|
|
|
},
|
|
|
|
userPermissions: {
|
|
|
|
deleteWorkItem: false,
|
|
|
|
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>',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export const updateWorkItemWidgetsResponse = {
|
|
|
|
data: {
|
|
|
|
workItemUpdateWidgets: {
|
|
|
|
workItem: {
|
|
|
|
id: 1234,
|
|
|
|
},
|
|
|
|
errors: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-02-09 13:16:19 -05:00
|
|
|
export const projectWorkItemTypesQueryResponse = {
|
|
|
|
data: {
|
|
|
|
workspace: {
|
2022-03-24 11:09:10 -04:00
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
2022-02-09 13:16:19 -05:00
|
|
|
workItemTypes: {
|
|
|
|
nodes: [
|
2022-03-24 11:09:10 -04:00
|
|
|
{ id: 'gid://gitlab/WorkItems::Type/1', name: 'Issue' },
|
|
|
|
{ id: 'gid://gitlab/WorkItems::Type/2', name: 'Incident' },
|
2022-05-02 08:10:01 -04:00
|
|
|
{ id: 'gid://gitlab/WorkItems::Type/3', name: 'Task' },
|
2022-02-09 13:16:19 -05:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-03-10 01:09:00 -05:00
|
|
|
|
|
|
|
export const createWorkItemMutationResponse = {
|
|
|
|
data: {
|
|
|
|
workItemCreate: {
|
|
|
|
__typename: 'WorkItemCreatePayload',
|
|
|
|
workItem: {
|
|
|
|
__typename: 'WorkItem',
|
2022-03-24 11:09:10 -04:00
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
2022-03-10 01:09:00 -05:00
|
|
|
title: 'Updated title',
|
2022-04-21 08:10:16 -04:00
|
|
|
state: 'OPEN',
|
2022-05-11 11:07:26 -04:00
|
|
|
description: 'description',
|
2022-03-10 01:09:00 -05:00
|
|
|
workItemType: {
|
|
|
|
__typename: 'WorkItemType',
|
2022-03-24 11:09:10 -04:00
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
2022-03-23 08:07:27 -04:00
|
|
|
name: 'Task',
|
2022-03-10 01:09:00 -05:00
|
|
|
},
|
2022-04-28 05:08:26 -04:00
|
|
|
userPermissions: {
|
|
|
|
deleteWorkItem: false,
|
|
|
|
updateWorkItem: false,
|
|
|
|
},
|
2022-05-31 05:08:17 -04:00
|
|
|
widgets: [],
|
2022-03-10 01:09:00 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-03-18 08:07:43 -04:00
|
|
|
|
|
|
|
export const createWorkItemFromTaskMutationResponse = {
|
|
|
|
data: {
|
|
|
|
workItemCreateFromTask: {
|
|
|
|
__typename: 'WorkItemCreateFromTaskPayload',
|
|
|
|
errors: [],
|
|
|
|
workItem: {
|
|
|
|
__typename: 'WorkItem',
|
2022-06-29 05:09:41 -04:00
|
|
|
description: 'New description',
|
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
|
|
|
title: 'Updated title',
|
|
|
|
state: 'OPEN',
|
|
|
|
workItemType: {
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
|
|
|
name: 'Task',
|
|
|
|
},
|
2022-04-28 05:08:26 -04:00
|
|
|
userPermissions: {
|
|
|
|
deleteWorkItem: false,
|
|
|
|
updateWorkItem: false,
|
|
|
|
},
|
2022-06-29 05:09:41 -04:00
|
|
|
widgets: [
|
|
|
|
{
|
|
|
|
__typename: 'WorkItemWidgetDescription',
|
|
|
|
type: 'DESCRIPTION',
|
|
|
|
description: 'New description',
|
|
|
|
descriptionHtml: '<p>New description</p>',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
newWorkItem: {
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
id: 'gid://gitlab/WorkItem/1000000',
|
|
|
|
title: 'Updated title',
|
|
|
|
state: 'OPEN',
|
|
|
|
description: '',
|
|
|
|
workItemType: {
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
|
|
|
name: 'Task',
|
|
|
|
},
|
|
|
|
userPermissions: {
|
|
|
|
deleteWorkItem: false,
|
|
|
|
updateWorkItem: false,
|
|
|
|
},
|
|
|
|
widgets: [],
|
2022-03-18 08:07:43 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-03-24 08:07:26 -04:00
|
|
|
|
2022-04-05 02:08:25 -04:00
|
|
|
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-03-24 08:07:26 -04:00
|
|
|
export const workItemTitleSubscriptionResponse = {
|
|
|
|
data: {
|
|
|
|
issuableTitleUpdated: {
|
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
|
|
|
title: 'new title',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-06-17 08:09:20 -04:00
|
|
|
|
|
|
|
export const workItemHierarchyEmptyResponse = {
|
|
|
|
data: {
|
|
|
|
workItem: {
|
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
|
|
|
workItemType: {
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/6',
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
},
|
|
|
|
title: 'New title',
|
|
|
|
widgets: [
|
|
|
|
{
|
|
|
|
type: 'DESCRIPTION',
|
|
|
|
__typename: 'WorkItemWidgetDescription',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'HIERARCHY',
|
|
|
|
parent: null,
|
|
|
|
children: {
|
|
|
|
nodes: [],
|
|
|
|
__typename: 'WorkItemConnection',
|
|
|
|
},
|
|
|
|
__typename: 'WorkItemWidgetHierarchy',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const workItemHierarchyResponse = {
|
|
|
|
data: {
|
|
|
|
workItem: {
|
|
|
|
id: 'gid://gitlab/WorkItem/1',
|
|
|
|
workItemType: {
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/6',
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
},
|
|
|
|
title: 'New title',
|
|
|
|
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',
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'gid://gitlab/WorkItem/3',
|
|
|
|
workItemType: {
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
},
|
|
|
|
title: 'abc',
|
|
|
|
state: 'CLOSED',
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'gid://gitlab/WorkItem/4',
|
|
|
|
workItemType: {
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
},
|
|
|
|
title: 'bar',
|
|
|
|
state: 'OPEN',
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'gid://gitlab/WorkItem/5',
|
|
|
|
workItemType: {
|
|
|
|
id: 'gid://gitlab/WorkItems::Type/5',
|
|
|
|
__typename: 'WorkItemType',
|
|
|
|
},
|
|
|
|
title: 'foobar',
|
|
|
|
state: 'OPEN',
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
__typename: 'WorkItemConnection',
|
|
|
|
},
|
|
|
|
__typename: 'WorkItemWidgetHierarchy',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
__typename: 'WorkItem',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-06-23 08:09:30 -04:00
|
|
|
|
|
|
|
export const availableWorkItemsResponse = {
|
|
|
|
data: {
|
|
|
|
workspace: {
|
|
|
|
__typename: 'Project',
|
|
|
|
id: 'gid://gitlab/Project/2',
|
|
|
|
workItems: {
|
|
|
|
edges: [
|
|
|
|
{
|
|
|
|
node: {
|
|
|
|
id: 'gid://gitlab/WorkItem/458',
|
|
|
|
title: 'Task 1',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
node: {
|
|
|
|
id: 'gid://gitlab/WorkItem/459',
|
|
|
|
title: 'Task 2',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-06-28 14:08:20 -04:00
|
|
|
|
|
|
|
export const projectMembersResponse = {
|
|
|
|
data: {
|
|
|
|
workspace: {
|
|
|
|
id: '1',
|
|
|
|
__typename: 'Project',
|
|
|
|
users: {
|
|
|
|
nodes: [
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'user-2',
|
|
|
|
user: {
|
|
|
|
__typename: 'UserCore',
|
|
|
|
id: 'gid://gitlab/User/5',
|
|
|
|
avatarUrl: '/avatar2',
|
|
|
|
name: 'rookie',
|
|
|
|
username: 'rookie',
|
|
|
|
webUrl: 'rookie',
|
|
|
|
status: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
];
|