diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-12 14:18:42 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-12 14:18:42 +0300 |
commit | 4c9264b695c2d44cc1c43febc88fc167786a4b52 (patch) | |
tree | 1ab03e142cb18b9dba2337d1d9a903e03c717bb4 /spec/features | |
parent | aa6f44328ed22ebab51440a5a04f6b62d6471b78 (diff) |
Fix milestone_filter_spec.rb by using wait_for_ajax and a correct user flow
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/dashboard/milestone_filter_spec.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/features/dashboard/milestone_filter_spec.rb b/spec/features/dashboard/milestone_filter_spec.rb index e9ca7fd50e7..d60a002a8d7 100644 --- a/spec/features/dashboard/milestone_filter_spec.rb +++ b/spec/features/dashboard/milestone_filter_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' -describe 'Dashboard > milestone filter', feature: true, js: true do +describe 'Dashboard > milestone filter', :feature, :js do + include WaitForAjax + let(:user) { create(:user) } let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:milestone) { create(:milestone, title: "v1.0", project: project) } @@ -26,30 +28,29 @@ describe 'Dashboard > milestone filter', feature: true, js: true do before do find(milestone_select).click + wait_for_ajax page.within('.dropdown-content') do click_link 'v1.0' end find(milestone_select).click + wait_for_ajax end it 'shows issues with Milestone v1.0' do expect(find('.issues-list')).to have_selector('.issue', count: 1) - - find(milestone_select).click - expect(find('.dropdown-content')).to have_selector('a.is-active', count: 1) end it 'should not change active Milestone unless clicked' do - find(milestone_select).trigger('click') - expect(find('.dropdown-content')).to have_selector('a.is-active', count: 1) # open & close dropdown find('.dropdown-menu-close').click + expect(find('.milestone-filter')).not_to have_selector('.dropdown.open') + find(milestone_select).click expect(find('.dropdown-content')).to have_selector('a.is-active', count: 1) |