Commit cd170f47 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'add-json-file-extension-to-fixtures' into 'master'

Add JSON file extension to fixtures

See merge request gitlab-org/gitlab!72486
parents 235758b7 e4093c89
...@@ -21,9 +21,10 @@ export const getStageByTitle = (stages, title) => ...@@ -21,9 +21,10 @@ export const getStageByTitle = (stages, title) =>
stages.find((stage) => stage.title && stage.title.toLowerCase().trim() === title) || {}; stages.find((stage) => stage.title && stage.title.toLowerCase().trim() === title) || {};
const fixtureEndpoints = { const fixtureEndpoints = {
customizableCycleAnalyticsStagesAndEvents: 'projects/analytics/value_stream_analytics/stages', customizableCycleAnalyticsStagesAndEvents:
stageEvents: (stage) => `projects/analytics/value_stream_analytics/events/${stage}`, 'projects/analytics/value_stream_analytics/stages.json',
metricsData: 'projects/analytics/value_stream_analytics/summary', 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 metricsData = getJSONFixture(fixtureEndpoints.metricsData);
......
...@@ -22,7 +22,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do ...@@ -22,7 +22,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
sign_in(user) sign_in(user)
end end
it 'projects/analytics/value_stream_analytics/stages' do it 'projects/analytics/value_stream_analytics/stages.json' do
get(:index, params: params, format: :json) get(:index, params: params, format: :json)
expect(response).to be_successful expect(response).to be_successful
...@@ -40,7 +40,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do ...@@ -40,7 +40,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
end end
Gitlab::Analytics::CycleAnalytics::DefaultStages.all.each do |stage| Gitlab::Analytics::CycleAnalytics::DefaultStages.all.each do |stage|
it "projects/analytics/value_stream_analytics/events/#{stage[:name]}" do it "projects/analytics/value_stream_analytics/events/#{stage[:name]}.json" do
get(stage[:name], params: params, format: :json) get(stage[:name], params: params, format: :json)
expect(response).to be_successful expect(response).to be_successful
...@@ -58,7 +58,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do ...@@ -58,7 +58,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
sign_in(user) sign_in(user)
end end
it "projects/analytics/value_stream_analytics/summary" do it "projects/analytics/value_stream_analytics/summary.json" do
get(:show, params: params, format: :json) get(:show, params: params, format: :json)
expect(response).to be_successful expect(response).to be_successful
......
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