Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mock_data.js « ci_lint « ci « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a9888817d04bfa85da2eb7c59d612fb4a3dfe67 (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
import { mockJobs } from 'jest/ci/pipeline_editor/mock_data';
import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';

export const mockLintDataError = {
  data: {
    lintCI: {
      errors: ['Error message'],
      warnings: ['Warning message'],
      valid: false,
      jobs: mockJobs.map((j) => {
        const job = { ...j, tags: j.tagList };
        delete job.tagList;
        return job;
      }),
    },
  },
};

export const mockLintDataValid = {
  data: {
    lintCI: {
      errors: [],
      warnings: [],
      valid: true,
      jobs: mockJobs.map((j) => {
        const job = { ...j, tags: j.tagList };
        delete job.tagList;
        return job;
      }),
    },
  },
};

export const mockLintDataErrorRest = {
  ...mockLintDataError.data.lintCI,
  jobs: mockJobs.map((j) => convertObjectPropsToSnakeCase(j)),
};

export const mockLintDataValidRest = {
  ...mockLintDataValid.data.lintCI,
  jobs: mockJobs.map((j) => convertObjectPropsToSnakeCase(j)),
};