Commit 64a7b7b5 authored by Florie Guibert's avatar Florie Guibert

Roadmap milestones settings

Review feedback
parent ff5c04db
...@@ -254,7 +254,7 @@ RSpec.describe 'group epic roadmap', :js do ...@@ -254,7 +254,7 @@ RSpec.describe 'group epic roadmap', :js do
end end
end end
def wait_for_milestones(count) def expect_milestones_count(count)
page.within('.roadmap-container .milestones-list-section') do page.within('.roadmap-container .milestones-list-section') do
expect(page).to have_selector('.milestone-item-details', count: count) expect(page).to have_selector('.milestone-item-details', count: count)
end end
...@@ -270,28 +270,19 @@ RSpec.describe 'group epic roadmap', :js do ...@@ -270,28 +270,19 @@ RSpec.describe 'group epic roadmap', :js do
end end
end end
it 'renders all milestones' do it 'renders milestones based on filter' do
select_milestones('Show all milestones') milestones_counts = {
'Show all milestones' => 4,
'Show group milestones' => 1,
'Show sub-group milestones' => 1,
'Show project milestones' => 2
}
wait_for_milestones(4) milestones_counts.each do |filter, count|
end select_milestones(filter)
it 'renders group milestones' do
select_milestones('Show group milestones')
wait_for_milestones(1)
end
it 'renders subgroup milestones' do
select_milestones('Show sub-group milestones')
wait_for_milestones(1) expect_milestones_count(count)
end end
it 'renders project milestones' do
select_milestones('Show project milestones')
wait_for_milestones(2)
end end
it 'turns off milestones' do it 'turns off milestones' 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