diff options
Diffstat (limited to 'spec/features/issues/form_spec.rb')
-rw-r--r-- | spec/features/issues/form_spec.rb | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 095cbb65c16..65d854d0896 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -3,7 +3,6 @@ require 'rails_helper' describe 'New/edit issue', :feature, :js do include GitlabRoutingHelper include ActionView::Helpers::JavaScriptHelper - include WaitForAjax let!(:project) { create(:project) } let!(:user) { create(:user)} @@ -24,11 +23,11 @@ describe 'New/edit issue', :feature, :js do visit new_namespace_project_issue_path(project.namespace, project) end - describe 'multiple assignees' do + describe 'single assignee' do before do click_button 'Unassigned' - - wait_for_ajax + + wait_for_requests end it 'unselects other assignees when unassigned is selected' do @@ -36,14 +35,12 @@ describe 'New/edit issue', :feature, :js do click_link user2.name end + click_button user2.name + page.within '.dropdown-menu-user' do click_link 'Unassigned' end - page.within '.js-assignee-search' do - expect(page).to have_content 'Unassigned' - end - expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match('0') end @@ -54,11 +51,13 @@ describe 'New/edit issue', :feature, :js do expect(find('a', text: 'Assign to me', visible: false)).not_to be_visible - page.within '.dropdown-menu-user' do + click_button user.name + + page.within('.dropdown-menu-user') do click_link user.name end - expect(find('a', text: 'Assign to me')).to be_visible + expect(page.find('.dropdown-menu-user', visible: false)).not_to be_visible end end @@ -69,7 +68,7 @@ describe 'New/edit issue', :feature, :js do expect(find('a', text: 'Assign to me')).to be_visible click_button 'Unassigned' - wait_for_ajax + wait_for_requests page.within '.dropdown-menu-user' do click_link user2.name @@ -154,25 +153,21 @@ describe 'New/edit issue', :feature, :js do it 'correctly updates the selected user when changing assignee' do click_button 'Unassigned' - - wait_for_ajax + + wait_for_requests page.within '.dropdown-menu-user' do click_link user.name end - expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user.id.to_s) - expect(find('.dropdown-menu-user a.is-active').first(:xpath, '..')['data-user-id']).to eq(user.id.to_s) - # check the ::before pseudo element to ensure checkmark icon is present - expect(before_for_selector('.dropdown-menu-selectable a.is-active')).not_to eq('') - expect(before_for_selector('.dropdown-menu-selectable a:not(.is-active)')).to eq('') + expect(find('.js-assignee-search')).to have_content(user.name) + click_button user.name page.within '.dropdown-menu-user' do click_link user2.name end - expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user2.id.to_s) - expect(find('.dropdown-menu-user a.is-active').first(:xpath, '..')['data-user-id']).to eq(user2.id.to_s) + expect(find('.js-assignee-search')).to have_content(user2.name) end end |