Commit ff9bcb08 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '227189-fix-broken-master' into 'master'

Improve a spec to make it faster and less flaky

Closes #227189

See merge request gitlab-org/gitlab!36215
parents dff774cf 203eba2a
......@@ -156,12 +156,9 @@ RSpec.describe 'group epic roadmap', :js do
end
context 'when over 1000 epics exist for the group' do
6.times do |i|
let!("epic_#{i}") { create(:epic, group: group, start_date: 10.days.ago, end_date: 1.day.ago) }
end
before do
stub_const('Groups::RoadmapController::EPICS_ROADMAP_LIMIT', 5)
stub_const('Groups::RoadmapController::EPICS_ROADMAP_LIMIT', 1)
create_list(:epic, 2, group: group, start_date: 10.days.ago, end_date: 1.day.ago)
visit group_roadmap_path(group)
wait_for_requests
end
......@@ -172,30 +169,23 @@ RSpec.describe 'group epic roadmap', :js do
expect(page).to have_selector('.js-epics-limit-callout', count: 1)
expect(find('.js-epics-limit-callout')).to have_content 'Some of your epics may not be visible. A roadmap is limited to the first 1,000 epics, in your selected sort order.'
end
page.within('.js-epics-limit-callout') do
expect(find_link('Learn more')[:href]).to eq("https://docs.gitlab.com/ee/user/group/roadmap/")
end
end
it 'is removed after dismissal' do
find('.js-epics-limit-callout .js-close-callout').click
it 'is removed after dismissal and even after reload' do
page.within('.js-epics-limit-callout') do
find('.js-close-callout').click
end
expect(page).not_to have_selector('.js-epics-limit-callout')
end
it 'does not appear on page after dismissal and reload' do
find('.js-epics-limit-callout .js-close-callout').click
visit group_roadmap_path(group)
wait_for_requests
refresh
expect(page).not_to have_selector('.js-epics-limit-callout')
end
it 'links to roadmap documentation' do
page.within('.js-epics-limit-callout') do
find('#js-learn-more').click
wait_for_requests
expect(URI.parse(current_url).host).to eq("docs.gitlab.com")
expect(URI.parse(current_url).path).to eq("/ee/user/group/roadmap/")
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