diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2017-05-12 21:05:50 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-05-16 19:08:52 +0300 |
commit | c316ce2525ab97c55a635bd513fc45f0de53eba3 (patch) | |
tree | 283c4cd3fe5b8ec12a8b646197090bb550f3a441 /spec/features/issues/form_spec.rb | |
parent | 2c5e70bec63aa707e5c91b9a7fadbb42de41e983 (diff) | |
parent | ec1a3c093f7a8d2fe29e46ec06e6b35e3f1d97ff (diff) |
Merge branch 'master' into '31987-automatically-close-assignee-select-dropdown-after-selection-when-multiple-assignees-is-disabled'
Diffstat (limited to 'spec/features/issues/form_spec.rb')
-rw-r--r-- | spec/features/issues/form_spec.rb | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 12a89ad723f..70f362a4743 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -1,9 +1,9 @@ require 'rails_helper' -require 'disable_css_animation_helper' -describe 'New/edit issue', feature: true, js: true do +describe 'New/edit issue', :feature, :js do include GitlabRoutingHelper include ActionView::Helpers::JavaScriptHelper + include WaitForAjax let!(:project) { create(:project) } let!(:user) { create(:user)} @@ -27,6 +27,32 @@ describe 'New/edit issue', feature: true, js: true do describe 'single assignee' do it 'hides assignee after selection' do click_button 'Unassigned' + + wait_for_ajax + end + + it 'unselects other assignees when unassigned is selected' do + page.within '.dropdown-menu-user' do + click_link user2.name + end + + 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 + + it 'toggles assign to me when current user is selected and unselected' do + page.within '.dropdown-menu-user' do + click_link user.name + end + + expect(find('a', text: 'Assign to me', visible: false)).not_to be_visible page.within('.dropdown-menu-user') do click_link user.name @@ -42,6 +68,9 @@ describe 'New/edit issue', feature: true, js: true do expect(find('a', text: 'Assign to me')).to be_visible click_button 'Unassigned' + + wait_for_ajax + page.within '.dropdown-menu-user' do click_link user2.name end @@ -125,16 +154,15 @@ describe 'New/edit issue', feature: true, js: true 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) - - click_button user.name - 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('') @@ -144,9 +172,6 @@ describe 'New/edit issue', feature: true, js: true do end expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user2.id.to_s) - - click_button user2.name - expect(find('.dropdown-menu-user a.is-active').first(:xpath, '..')['data-user-id']).to eq(user2.id.to_s) end end @@ -208,4 +233,4 @@ describe 'New/edit issue', feature: true, js: true do JS page.evaluate_script(js) end -end +end
\ No newline at end of file |