Commit 554e4341 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Fix task by type specs

Updates the shared data used in the charts
spec and fixes the task by type specs
parent f8a919bc
...@@ -6,11 +6,16 @@ RSpec.describe 'Value stream analytics charts', :js do ...@@ -6,11 +6,16 @@ RSpec.describe 'Value stream analytics charts', :js do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group, name: 'CA-test-group') } let_it_be(:group) { create(:group, name: 'CA-test-group') }
let_it_be(:group2) { create(:group, name: 'CA-bad-test-group') }
let_it_be(:project) { create(:project, :repository, namespace: group, group: group, name: 'Cool fun project') } let_it_be(:project) { create(:project, :repository, namespace: group, group: group, name: 'Cool fun project') }
let_it_be(:group_label1) { create(:group_label, group: group) } let_it_be(:group_with_value_stream) { create(:group, name: 'CA-vsa-test-group') }
let_it_be(:group_label2) { create(:group_label, group: group) } let_it_be(:vsa_group_project) { create(:project, :repository, namespace: group_with_value_stream, group: group_with_value_stream) }
let_it_be(:label) { create(:group_label, group: group2) } let_it_be(:value_stream) { create(:cycle_analytics_group_value_stream, group: group_with_value_stream, name: 'First value stream') }
let_it_be(:vsa_stages) do
[
create(:cycle_analytics_group_stage, group: group_with_value_stream, name: "Issue", relative_position: 1, value_stream: value_stream),
create(:cycle_analytics_group_stage, group: group_with_value_stream, name: "Code", relative_position: 2, value_stream: value_stream)
]
end
empty_state_selector = '[data-testid="vsa-empty-state"]' empty_state_selector = '[data-testid="vsa-empty-state"]'
...@@ -26,6 +31,7 @@ RSpec.describe 'Value stream analytics charts', :js do ...@@ -26,6 +31,7 @@ RSpec.describe 'Value stream analytics charts', :js do
before_all do before_all do
group.add_owner(user) group.add_owner(user)
group_with_value_stream.add_owner(user)
end end
before do before do
...@@ -162,8 +168,10 @@ RSpec.describe 'Value stream analytics charts', :js do ...@@ -162,8 +168,10 @@ RSpec.describe 'Value stream analytics charts', :js do
sign_in(user) sign_in(user)
end end
context 'type_of_work_analytics enabled' do
context 'use_vsa_aggregated_tables feature flag off' do context 'use_vsa_aggregated_tables feature flag off' do
let(:selected_group) { group }
let(:selected_project) { project }
before do before do
stub_feature_flags(use_vsa_aggregated_tables: false) stub_feature_flags(use_vsa_aggregated_tables: false)
end end
...@@ -181,13 +189,11 @@ RSpec.describe 'Value stream analytics charts', :js do ...@@ -181,13 +189,11 @@ RSpec.describe 'Value stream analytics charts', :js do
end end
context 'with a value stream' do context 'with a value stream' do
before do let(:selected_group) { group_with_value_stream }
create(:cycle_analytics_group_value_stream, group: group, name: 'First value stream') let(:selected_project) { vsa_group_project }
end
it_behaves_like 'has the tasks by type chart' it_behaves_like 'has the tasks by type chart'
end end
end end
end end
end
end end
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