Commit bc498ba0 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'refactor-rspec-test-suite' into 'master'

Refactor RSpec test suite to remove duplication

See merge request gitlab-org/gitlab!18532
parents 915aa1ac cd453d98
......@@ -39,9 +39,12 @@ describe 'Dropdown milestone', :js do
end
describe 'behavior' do
it 'opens when the search bar has milestone:' do
context 'filters by "milestone:"' do
before do
filtered_search.set('milestone:')
end
it 'opens when the search bar has milestone:' do
expect(page).to have_css(js_dropdown_milestone, visible: true)
end
......@@ -51,24 +54,21 @@ describe 'Dropdown milestone', :js do
expect(page).to have_css(js_dropdown_milestone, visible: false)
end
it 'shows loading indicator when opened' do
slow_requests do
filtered_search.set('milestone:')
expect(page).to have_css('#js-dropdown-milestone .filter-dropdown-loading', visible: true)
end
end
it 'hides loading indicator when loaded' do
filtered_search.set('milestone:')
expect(find(js_dropdown_milestone)).not_to have_css('.filter-dropdown-loading')
end
it 'loads all the milestones when opened' do
expect(filter_dropdown).to have_selector('.filter-dropdown .filter-dropdown-item', count: 6)
end
end
it 'shows loading indicator when opened' do
slow_requests do
filtered_search.set('milestone:')
expect(filter_dropdown).to have_selector('.filter-dropdown .filter-dropdown-item', count: 6)
expect(page).to have_css('#js-dropdown-milestone .filter-dropdown-loading', visible: true)
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