Commit 95862f8c authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '339346-change-get-json-a04afc32f48' into 'master'

Use import for json fixture - 7/7

See merge request gitlab-org/gitlab!71904
parents 3f242db4 e1c2a473
import tasksByType from 'test_fixtures/analytics/charts/type_of_work/tasks_by_type.json';
import { uniq } from 'lodash';
import {
TASKS_BY_TYPE_SUBJECT_ISSUE,
......@@ -182,9 +183,7 @@ export const labelEndEvent = customStageLabelEvents.find(
const dateRange = getDatesInRange(createdAfter, createdBefore, toYmd);
export const apiTasksByTypeData = getJSONFixture(
'analytics/charts/type_of_work/tasks_by_type.json',
).map((labelData) => {
export const apiTasksByTypeData = tasksByType.map((labelData) => {
// add data points for our mock date range
const maxValue = 10;
const series = dateRange.map((date) => [date, Math.floor(Math.random() * Math.floor(maxValue))]);
......
import json from 'test_fixtures/graphql/analytics/devops_report/devops_adoption/graphql/queries/devops_adoption_enabled_namespaces.query.graphql.json';
import { DEVOPS_ADOPTION_TABLE_CONFIGURATION } from 'ee/analytics/devops_report/devops_adoption/constants';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
const json = getJSONFixture(
'graphql/analytics/devops_report/devops_adoption/graphql/queries/devops_adoption_enabled_namespaces.query.graphql.json',
);
export const devopsAdoptionNamespaceData = json.data.devopsAdoptionEnabledNamespaces;
export const groupData = devopsAdoptionNamespaceData.nodes.map((node) => {
......
import * as Sentry from '@sentry/browser';
import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import lastWeekData from 'test_fixtures/api/dora/metrics/daily_deployment_frequency_for_last_week.json';
import lastMonthData from 'test_fixtures/api/dora/metrics/daily_deployment_frequency_for_last_month.json';
import last90DaysData from 'test_fixtures/api/dora/metrics/daily_deployment_frequency_for_last_90_days.json';
import { useFixturesFakeDate } from 'helpers/fake_date';
import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils';
......@@ -9,16 +12,6 @@ import CiCdAnalyticsCharts from '~/vue_shared/components/ci_cd_analytics/ci_cd_a
jest.mock('~/flash');
const lastWeekData = getJSONFixture(
'api/dora/metrics/daily_deployment_frequency_for_last_week.json',
);
const lastMonthData = getJSONFixture(
'api/dora/metrics/daily_deployment_frequency_for_last_month.json',
);
const last90DaysData = getJSONFixture(
'api/dora/metrics/daily_deployment_frequency_for_last_90_days.json',
);
describe('deployment_frequency_charts.vue', () => {
useFixturesFakeDate();
......
import { GlSprintf } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import lastWeekData from 'test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_week.json';
import lastMonthData from 'test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_month.json';
import last90DaysData from 'test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_90_days.json';
import { useFixturesFakeDate } from 'helpers/fake_date';
import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils';
......@@ -9,16 +12,6 @@ import CiCdAnalyticsCharts from '~/vue_shared/components/ci_cd_analytics/ci_cd_a
jest.mock('~/flash');
const lastWeekData = getJSONFixture(
'api/dora/metrics/daily_lead_time_for_changes_for_last_week.json',
);
const lastMonthData = getJSONFixture(
'api/dora/metrics/daily_lead_time_for_changes_for_last_month.json',
);
const last90DaysData = getJSONFixture(
'api/dora/metrics/daily_lead_time_for_changes_for_last_90_days.json',
);
describe('lead_time_charts.vue', () => {
useFixturesFakeDate();
......
import lastWeekData from 'test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_week.json';
import { apiDataToChartSeries, buildNullSeriesForLeadTimeChart } from 'ee/dora/components/util';
const lastWeekData = getJSONFixture(
'api/dora/metrics/daily_lead_time_for_changes_for_last_week.json',
);
describe('ee/dora/components/util.js', () => {
describe('apiDataToChartSeries', () => {
it('transforms the data from the API into data the chart component can use', () => {
......
import metaFixture from 'test_fixtures/epic/mock_meta.json';
import mockDataFixture from 'test_fixtures/epic/mock_data.json';
import { TEST_HOST } from 'spec/test_constants';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
const metaFixture = getJSONFixture('epic/mock_meta.json');
const meta = JSON.parse(metaFixture.meta);
const initial = JSON.parse(metaFixture.initial);
......@@ -14,7 +15,7 @@ export const mockEpicMeta = {
export const mockEpicData = convertObjectPropsToCamelCase(
{
...getJSONFixture('epic/mock_data.json'),
...mockDataFixture,
...initial,
endpoint: TEST_HOST,
sidebarCollapsed: false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment