diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb')
-rw-r--r-- | spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb b/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb index 9fe11070187..4e4c0e509b0 100644 --- a/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb +++ b/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb @@ -2,23 +2,50 @@ require 'spec_helper' -RSpec.describe 'Groups > User sees users dropdowns in issuables list' do - let(:entity) { create(:group) } +RSpec.describe 'Groups > User sees users dropdowns in issuables list', :js do + include FilteredSearchHelpers + + let(:group) { create(:group) } let(:user_in_dropdown) { create(:user) } let!(:user_not_in_dropdown) { create(:user) } - let!(:project) { create(:project, group: entity) } + let!(:project) { create(:project, group: group) } before do - entity.add_developer(user_in_dropdown) + group.add_developer(user_in_dropdown) + sign_in(user_in_dropdown) end - it_behaves_like 'issuable user dropdown behaviors' do - let(:issuable) { create(:issue, project: project) } - let(:issuables_path) { issues_group_path(entity) } + describe 'issues' do + let!(:issuable) { create(:issue, project: project) } + + %w[Author Assignee].each do |dropdown| + describe "#{dropdown} dropdown" do + it 'only includes members of the project/group' do + visit issues_group_path(group) + + select_tokens dropdown, '=', submit: false + + expect_suggestion(user_in_dropdown.name) + expect_no_suggestion(user_not_in_dropdown.name) + end + end + end end - it_behaves_like 'issuable user dropdown behaviors' do - let(:issuable) { create(:merge_request, source_project: project) } - let(:issuables_path) { merge_requests_group_path(entity) } + describe 'merge requests' do + let!(:issuable) { create(:merge_request, source_project: project) } + + %w[author assignee].each do |dropdown| + describe "#{dropdown} dropdown" do + it 'only includes members of the project/group' do + visit merge_requests_group_path(group) + + filtered_search.set("#{dropdown}:=") + + expect(find("#js-dropdown-#{dropdown} .filter-dropdown")).to have_content(user_in_dropdown.name) + expect(find("#js-dropdown-#{dropdown} .filter-dropdown")).not_to have_content(user_not_in_dropdown.name) + end + end + end end end |