diff options
Diffstat (limited to 'spec/frontend/cycle_analytics/mock_data.js')
-rw-r--r-- | spec/frontend/cycle_analytics/mock_data.js | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/spec/frontend/cycle_analytics/mock_data.js b/spec/frontend/cycle_analytics/mock_data.js index 1882457960a..077df3d52fe 100644 --- a/spec/frontend/cycle_analytics/mock_data.js +++ b/spec/frontend/cycle_analytics/mock_data.js @@ -1,6 +1,11 @@ -/* eslint-disable import/no-deprecated */ +import valueStreamAnalyticsStages from 'test_fixtures/projects/analytics/value_stream_analytics/stages.json'; +import issueStageFixtures from 'test_fixtures/projects/analytics/value_stream_analytics/events/issue.json'; +import planStageFixtures from 'test_fixtures/projects/analytics/value_stream_analytics/events/plan.json'; +import reviewStageFixtures from 'test_fixtures/projects/analytics/value_stream_analytics/events/review.json'; +import codeStageFixtures from 'test_fixtures/projects/analytics/value_stream_analytics/events/code.json'; +import testStageFixtures from 'test_fixtures/projects/analytics/value_stream_analytics/events/test.json'; +import stagingStageFixtures from 'test_fixtures/projects/analytics/value_stream_analytics/events/staging.json'; -import { getJSONFixture } from 'helpers/fixtures'; import { TEST_HOST } from 'helpers/test_constants'; import { DEFAULT_VALUE_STREAM, @@ -20,28 +25,16 @@ export const deepCamelCase = (obj) => convertObjectPropsToCamelCase(obj, { deep: export const getStageByTitle = (stages, title) => stages.find((stage) => stage.title && stage.title.toLowerCase().trim() === title) || {}; -const fixtureEndpoints = { - customizableCycleAnalyticsStagesAndEvents: - 'projects/analytics/value_stream_analytics/stages.json', - stageEvents: (stage) => `projects/analytics/value_stream_analytics/events/${stage}.json`, - metricsData: 'projects/analytics/value_stream_analytics/summary.json', -}; - -export const metricsData = getJSONFixture(fixtureEndpoints.metricsData); - -export const customizableStagesAndEvents = getJSONFixture( - fixtureEndpoints.customizableCycleAnalyticsStagesAndEvents, -); - export const defaultStages = ['issue', 'plan', 'review', 'code', 'test', 'staging']; -const stageFixtures = defaultStages.reduce((acc, stage) => { - const events = getJSONFixture(fixtureEndpoints.stageEvents(stage)); - return { - ...acc, - [stage]: events, - }; -}, {}); +const stageFixtures = { + issue: issueStageFixtures, + plan: planStageFixtures, + review: reviewStageFixtures, + code: codeStageFixtures, + test: testStageFixtures, + staging: stagingStageFixtures, +}; export const summary = [ { value: '20', title: 'New Issues' }, @@ -260,7 +253,7 @@ export const selectedProjects = [ }, ]; -export const rawValueStreamStages = customizableStagesAndEvents.stages; +export const rawValueStreamStages = valueStreamAnalyticsStages.stages; export const valueStreamStages = rawValueStreamStages.map((s) => convertObjectPropsToCamelCase(s, { deep: true }), |