summaryrefslogtreecommitdiff
path: root/spec/frontend/work_items/mock_data.js
blob: 832795fc4acf0ba13cf92d217dadf9699d66cc2b (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
export const workItemQueryResponse = {
  workItem: {
    __typename: 'WorkItem',
    id: '1',
    title: 'Test',
    workItemType: {
      __typename: 'WorkItemType',
      id: 'work-item-type-1',
    },
    widgets: {
      __typename: 'LocalWorkItemWidgetConnection',
      nodes: [
        {
          __typename: 'LocalTitleWidget',
          type: 'TITLE',
          contentText: 'Test',
        },
      ],
    },
  },
};

export const updateWorkItemMutationResponse = {
  data: {
    workItemUpdate: {
      __typename: 'LocalUpdateWorkItemPayload',
      workItem: {
        __typename: 'LocalWorkItem',
        id: '1',
        title: 'Updated title',
        workItemType: {
          __typename: 'WorkItemType',
          id: 'work-item-type-1',
        },
        widgets: {
          __typename: 'LocalWorkItemWidgetConnection',
          nodes: [
            {
              __typename: 'LocalTitleWidget',
              type: 'TITLE',
              enabled: true,
              contentText: 'Updated title',
            },
          ],
        },
      },
    },
  },
};

export const projectWorkItemTypesQueryResponse = {
  data: {
    workspace: {
      id: '1',
      workItemTypes: {
        nodes: [
          { id: 'work-item-1', name: 'Issue' },
          { id: 'work-item-2', name: 'Incident' },
        ],
      },
    },
  },
};

export const createWorkItemMutationResponse = {
  data: {
    workItemCreate: {
      __typename: 'WorkItemCreatePayload',
      workItem: {
        __typename: 'WorkItem',
        id: '1',
        title: 'Updated title',
        workItemType: {
          __typename: 'WorkItemType',
          id: 'work-item-type-1',
        },
      },
    },
  },
};