diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/features/issues/issue_sidebar_spec.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/features/issues/issue_sidebar_spec.rb')
-rw-r--r-- | spec/features/issues/issue_sidebar_spec.rb | 136 |
1 files changed, 45 insertions, 91 deletions
diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 38d11ee2560..94a1de06488 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -16,129 +16,83 @@ RSpec.describe 'Issue Sidebar' do sign_in(user) end - context 'assignee', :js do + context 'when concerning the assignee', :js do let(:user2) { create(:user) } let(:issue2) { create(:issue, project: project, author: user2) } - context 'when invite_members_version_a experiment is enabled' do - before do - stub_experiment_for_user(invite_members_version_a: true) - end + include_examples 'issuable invite members experiments' do + let(:issuable_path) { project_issue_path(project, issue2) } + end - context 'when user can not see invite members' do - before do - project.add_developer(user) - visit_issue(project, issue2) + context 'when user is a developer' do + before do + project.add_developer(user) + visit_issue(project, issue2) - find('.block.assignee .edit-link').click + find('.block.assignee .edit-link').click - wait_for_requests - end + wait_for_requests + end - it 'does not see link to invite members' do - page.within '.dropdown-menu-user' do - expect(page).not_to have_link('Invite Members') - end + it 'shows author in assignee dropdown' do + page.within '.dropdown-menu-user' do + expect(page).to have_content(user2.name) end end - context 'when user can see invite members' do - before do - project.add_maintainer(user) - visit_issue(project, issue2) - - find('.block.assignee .edit-link').click + it 'shows author when filtering assignee dropdown' do + page.within '.dropdown-menu-user' do + find('.dropdown-input-field').set(user2.name) wait_for_requests - end - it 'sees link to invite members' do - page.within '.dropdown-menu-user' do - expect(page).to have_link('Invite Members', href: project_project_members_path(project)) - expect(page).to have_selector('[data-track-event="click_invite_members"]') - expect(page).to have_selector("[data-track-label='edit_assignee']") - end + expect(page).to have_content(user2.name) end end - end - - context 'when invite_members_version_a experiment is not enabled' do - context 'when user is a developer' do - before do - project.add_developer(user) - visit_issue(project, issue2) - find('.block.assignee .edit-link').click + it 'assigns yourself' do + find('.block.assignee .dropdown-menu-toggle').click - wait_for_requests - end - - it 'shows author in assignee dropdown' do - page.within '.dropdown-menu-user' do - expect(page).to have_content(user2.name) - end - end + click_button 'assign yourself' - it 'shows author when filtering assignee dropdown' do - page.within '.dropdown-menu-user' do - find('.dropdown-input-field').native.send_keys user2.name - sleep 1 # Required to wait for end of input delay + wait_for_requests - wait_for_requests + find('.block.assignee .edit-link').click - expect(page).to have_content(user2.name) - end + page.within '.dropdown-menu-user' do + expect(page.find('.dropdown-header')).to be_visible + expect(page.find('.dropdown-menu-user-link.is-active')).to have_content(user.name) end + end - it 'assigns yourself' do - find('.block.assignee .dropdown-menu-toggle').click - - click_button 'assign yourself' - - wait_for_requests + it 'keeps your filtered term after filtering and dismissing the dropdown' do + find('.dropdown-input-field').set(user2.name) - find('.block.assignee .edit-link').click + wait_for_requests - page.within '.dropdown-menu-user' do - expect(page.find('.dropdown-header')).to be_visible - expect(page.find('.dropdown-menu-user-link.is-active')).to have_content(user.name) - end + page.within '.dropdown-menu-user' do + expect(page).not_to have_content 'Unassigned' + click_link user2.name end - it 'keeps your filtered term after filtering and dismissing the dropdown' do - find('.dropdown-input-field').native.send_keys user2.name - - wait_for_requests - - page.within '.dropdown-menu-user' do - expect(page).not_to have_content 'Unassigned' - click_link user2.name - end - - find('.js-right-sidebar').click - find('.block.assignee .edit-link').click + find('.js-right-sidebar').click + find('.block.assignee .edit-link').click - expect(page.all('.dropdown-menu-user li').length).to eq(1) - expect(find('.dropdown-input-field').value).to eq(user2.name) - end + expect(page.all('.dropdown-menu-user li').length).to eq(1) + expect(find('.dropdown-input-field').value).to eq(user2.name) end + end - context 'when user is a maintainer' do - before do - project.add_maintainer(user) - visit_issue(project, issue2) + it 'shows label text as "Apply" when assignees are changed' do + project.add_developer(user) + visit_issue(project, issue2) - find('.block.assignee .edit-link').click + find('.block.assignee .edit-link').click + wait_for_requests - wait_for_requests - end + click_on 'Unassigned' - it 'shows author in assignee dropdown and no invite link' do - page.within '.dropdown-menu-user' do - expect(page).not_to have_link('Invite Members') - end - end - end + expect(page).to have_link('Apply') end end |