summaryrefslogtreecommitdiff
path: root/spec/frontend/jira_import/mock_data.js
blob: 51dd939283ea696fd5169577d90ba0ebb8652262 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import getJiraImportDetailsQuery from '~/jira_import/queries/get_jira_import_details.query.graphql';
import { IMPORT_STATE } from '~/jira_import/utils/jira_import_utils';
import { userMappingsPageSize } from '~/jira_import/utils/constants';

export const fullPath = 'gitlab-org/gitlab-test';

export const issuesPath = 'gitlab-org/gitlab-test/-/issues';

export const illustration = 'illustration.svg';

export const jiraIntegrationPath = 'gitlab-org/gitlab-test/-/services/jira/edit';

export const projectId = '5';

export const projectPath = 'gitlab-org/gitlab-test';

export const queryDetails = {
  query: getJiraImportDetailsQuery,
  variables: {
    fullPath,
  },
};

export const jiraImportDetailsQueryResponse = {
  project: {
    jiraImportStatus: IMPORT_STATE.NONE,
    jiraImports: {
      nodes: [
        {
          jiraProjectKey: 'MJP',
          scheduledAt: '2020-01-01T12:34:56Z',
          scheduledBy: {
            name: 'Jane Doe',
            __typename: 'User',
          },
          __typename: 'JiraImport',
        },
      ],
      __typename: 'JiraImportConnection',
    },
    services: {
      nodes: [
        {
          projects: {
            nodes: [
              {
                key: 'MJP',
                name: 'My Jira Project',
                __typename: 'JiraProject',
              },
              {
                key: 'MTG',
                name: 'Migrate To GitLab',
                __typename: 'JiraProject',
              },
            ],
            __typename: 'JiraProjectConnection',
          },
          __typename: 'JiraService',
        },
      ],
      __typename: 'ServiceConnection',
    },
    __typename: 'Project',
  },
};

export const jiraImportMutationResponse = {
  jiraImportStart: {
    clientMutationId: null,
    jiraImport: {
      jiraProjectKey: 'MTG',
      scheduledAt: '2020-02-02T20:20:20Z',
      scheduledBy: {
        name: 'John Doe',
        __typename: 'User',
      },
      __typename: 'JiraImport',
    },
    errors: [],
    __typename: 'JiraImportStartPayload',
  },
};

export const jiraProjects = [
  { text: 'My Jira Project (MJP)', value: 'MJP' },
  { text: 'My Second Jira Project (MSJP)', value: 'MSJP' },
  { text: 'Migrate to GitLab (MTG)', value: 'MTG' },
];

export const jiraUsersResponse = new Array(userMappingsPageSize);

export const imports = [
  {
    jiraProjectKey: 'MTG',
    scheduledAt: '2020-04-08T10:11:12+00:00',
    scheduledBy: {
      name: 'John Doe',
    },
  },
  {
    jiraProjectKey: 'MSJP',
    scheduledAt: '2020-04-09T13:14:15+00:00',
    scheduledBy: {
      name: 'Jimmy Doe',
    },
  },
  {
    jiraProjectKey: 'MTG',
    scheduledAt: '2020-04-09T16:17:18+00:00',
    scheduledBy: {
      name: 'Jane Doe',
    },
  },
];

export const userMappings = [
  {
    jiraAccountId: 'aei23f98f-q23fj98qfj',
    jiraDisplayName: 'Jane Doe',
    jiraEmail: 'janedoe@example.com',
    gitlabId: 15,
    gitlabUsername: 'janedoe',
  },
  {
    jiraAccountId: 'fu39y8t34w-rq3u289t3h4i',
    jiraDisplayName: 'Fred Chopin',
    jiraEmail: 'fredchopin@example.com',
    gitlabId: undefined,
    gitlabUsername: undefined,
  },
];