summaryrefslogtreecommitdiff
path: root/spec/frontend/pipelines/notification/mock_data.js
blob: e36f391a85454829f9b0b742db82cf000bcd4758 (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
const randomWarning = {
  content: 'another random warning',
  id: 'gid://gitlab/Ci::PipelineMessage/272',
};

const rootTypeWarning = {
  content: 'root `types` will be removed in 15.0.',
  id: 'gid://gitlab/Ci::PipelineMessage/273',
};

const typeWarning = {
  content: '`type` will be removed in 15.0.',
  id: 'gid://gitlab/Ci::PipelineMessage/274',
};

function createWarningMock(warnings) {
  return {
    data: {
      project: {
        id: 'gid://gitlab/Project/28"',
        pipeline: {
          id: 'gid://gitlab/Ci::Pipeline/183',
          warningMessages: warnings,
        },
      },
    },
  };
}

export const mockWarningsWithoutDeprecation = createWarningMock([randomWarning]);
export const mockWarningsRootType = createWarningMock([rootTypeWarning]);
export const mockWarningsType = createWarningMock([typeWarning]);
export const mockWarningsTypesAll = createWarningMock([rootTypeWarning, typeWarning]);