summaryrefslogtreecommitdiff
path: root/spec/frontend/pipeline_wizard/mock/query_responses.js
blob: 95dcb881a04c8f4418c6aee641bfda0dd27a4e54 (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
export const createCommitMutationResult = {
  data: {
    commitCreate: {
      commit: {
        id: '82a9df1',
      },
      content: 'foo: bar',
      errors: null,
    },
  },
};

export const createCommitMutationErrorResult = {
  data: {
    commitCreate: {
      commit: null,
      content: null,
      errors: ['Some Error Message'],
    },
  },
};

export const fileQueryResult = {
  data: {
    project: {
      id: 'gid://gitlab/Project/1',
      repository: {
        blobs: {
          nodes: [
            {
              id: 'gid://gitlab/Blob/9ff96777b315cd37188f7194d8382c718cb2933c',
            },
          ],
        },
      },
    },
  },
};

export const fileQueryEmptyResult = {
  data: {
    project: {
      id: 'gid://gitlab/Project/2',
      repository: {
        blobs: {
          nodes: [],
        },
      },
    },
  },
};

export const fileQueryErrorResult = {
  data: {
    foo: 'bar',
    project: {
      id: null,
      repository: null,
    },
  },
  errors: [{ message: 'GraphQL Error' }],
};