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