Commit eaebe279 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by Martin Wortschack

Added fixture spec for time summary

Adds fixture spec to generate mock
data for the FE specs
parent f9ac8102
...@@ -21,12 +21,14 @@ const fixtureEndpoints = { ...@@ -21,12 +21,14 @@ const fixtureEndpoints = {
stageEvents: stage => `analytics/value_stream_analytics/stages/${stage}/records.json`, stageEvents: stage => `analytics/value_stream_analytics/stages/${stage}/records.json`,
stageMedian: stage => `analytics/value_stream_analytics/stages/${stage}/median.json`, stageMedian: stage => `analytics/value_stream_analytics/stages/${stage}/median.json`,
recentActivityData: 'analytics/value_stream_analytics/summary.json', recentActivityData: 'analytics/value_stream_analytics/summary.json',
timeMetricsData: 'analytics/value_stream_analytics/time_summary.json',
groupLabels: 'api/group_labels.json', groupLabels: 'api/group_labels.json',
}; };
export const endpoints = { export const endpoints = {
groupLabels: /groups\/[A-Z|a-z|\d|\-|_]+\/-\/labels.json/, groupLabels: /groups\/[A-Z|a-z|\d|\-|_]+\/-\/labels.json/,
recentActivityData: /analytics\/value_stream_analytics\/summary/, recentActivityData: /analytics\/value_stream_analytics\/summary/,
timeMetricsData: /analytics\/value_stream_analytics\/time_summary/,
durationData: /analytics\/value_stream_analytics\/stages\/\d+\/duration_chart/, durationData: /analytics\/value_stream_analytics\/stages\/\d+\/duration_chart/,
stageData: /analytics\/value_stream_analytics\/stages\/\d+\/records/, stageData: /analytics\/value_stream_analytics\/stages\/\d+\/records/,
stageMedian: /analytics\/value_stream_analytics\/stages\/\d+\/median/, stageMedian: /analytics\/value_stream_analytics\/stages\/\d+\/median/,
...@@ -53,10 +55,7 @@ const getStageByTitle = (stages, title) => ...@@ -53,10 +55,7 @@ const getStageByTitle = (stages, title) =>
stages.find(stage => stage.title && stage.title.toLowerCase().trim() === title) || {}; stages.find(stage => stage.title && stage.title.toLowerCase().trim() === title) || {};
export const recentActivityData = getJSONFixture(fixtureEndpoints.recentActivityData); export const recentActivityData = getJSONFixture(fixtureEndpoints.recentActivityData);
export const timeMetricsData = [ export const timeMetricsData = getJSONFixture(fixtureEndpoints.timeMetricsData);
{ label: 'Lead time', value: '2', unit: 'days' },
{ label: 'Cycle time', value: '1.5', unit: 'days' },
];
export const customizableStagesAndEvents = getJSONFixture( export const customizableStagesAndEvents = getJSONFixture(
fixtureEndpoints.customizableCycleAnalyticsStagesAndEvents, fixtureEndpoints.customizableCycleAnalyticsStagesAndEvents,
......
...@@ -203,6 +203,12 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do ...@@ -203,6 +203,12 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
expect(response).to be_successful expect(response).to be_successful
end end
it 'analytics/value_stream_analytics/time_summary.json' do
get(:show, params: params, format: :json)
expect(response).to be_successful
end
end end
describe Analytics::TasksByTypeController, type: :controller do describe Analytics::TasksByTypeController, type: :controller do
......
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