diff options
author | Phil Hughes <me@iamphill.com> | 2017-05-18 07:41:14 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-05-18 07:41:14 +0000 |
commit | a49337727be1e28c29ad19b310fa2eb2df828c91 (patch) | |
tree | 22ce367b8e4f13885d5e8b0d679c9dfe487d9bfe /spec/features | |
parent | 3bbf9575112a0829f9926d04baea53705a7ba4b5 (diff) | |
parent | fbe1e00e8202c3dfccb45db6e4ce96f8dc0895e7 (diff) | |
download | gitlab-ce-a49337727be1e28c29ad19b310fa2eb2df828c91.tar.gz |
Merge branch '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled' into 'master'
Automatically close user dropdown for CE
Closes #31987
See merge request !11189
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/boards/sidebar_spec.rb | 1 | ||||
-rw-r--r-- | spec/features/issues/form_spec.rb | 28 | ||||
-rw-r--r-- | spec/features/issues_spec.rb | 4 |
3 files changed, 12 insertions, 21 deletions
diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index 1238647d3f3..4667be49fe6 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -115,7 +115,6 @@ describe 'Issue Boards', feature: true, js: true do click_link 'Unassigned' end - find('.dropdown-menu-toggle').click wait_for_vue_resource expect(page).to have_content('No assignee') diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 095cbb65c16..5c0907e26df 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -24,10 +24,10 @@ 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 end @@ -36,14 +36,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 +52,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 @@ -154,25 +154,21 @@ describe 'New/edit issue', :feature, :js do it 'correctly updates the selected user when changing assignee' do click_button 'Unassigned' - + wait_for_ajax 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 diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index fdd78600a1d..da369a6f111 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -465,8 +465,6 @@ describe 'Issues', feature: true do click_link 'Edit' click_link @user.name - find('.dropdown-menu-toggle').click - page.within '.value .author' do expect(page).to have_content @user.name end @@ -474,8 +472,6 @@ describe 'Issues', feature: true do click_link 'Edit' click_link @user.name - find('.dropdown-menu-toggle').click - page.within '.value .assign-yourself' do expect(page).to have_content "No assignee" end |