summaryrefslogtreecommitdiff
path: root/spec/features/groups/members
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/groups/members')
-rw-r--r--spec/features/groups/members/leave_group_spec.rb2
-rw-r--r--spec/features/groups/members/manage_groups_spec.rb20
2 files changed, 21 insertions, 1 deletions
diff --git a/spec/features/groups/members/leave_group_spec.rb b/spec/features/groups/members/leave_group_spec.rb
index e6bf1ffc2f7..9612c6625f6 100644
--- a/spec/features/groups/members/leave_group_spec.rb
+++ b/spec/features/groups/members/leave_group_spec.rb
@@ -79,7 +79,7 @@ RSpec.describe 'Groups > Members > Leave group' do
visit group_path(group, leave: 1)
- expect(find('.flash-alert')).to have_content 'You do not have permission to leave this group'
+ expect(find('[data-testid="alert-danger"]')).to have_content 'You do not have permission to leave this group'
end
def left_group_message(group)
diff --git a/spec/features/groups/members/manage_groups_spec.rb b/spec/features/groups/members/manage_groups_spec.rb
index 2beecda23b5..61c6709f9cc 100644
--- a/spec/features/groups/members/manage_groups_spec.rb
+++ b/spec/features/groups/members/manage_groups_spec.rb
@@ -156,6 +156,26 @@ RSpec.describe 'Groups > Members > Manage groups', :js do
group_outside_hierarchy.add_owner(user)
end
+ context 'when the invite members group modal is enabled' do
+ it 'does not show self or ancestors', :aggregate_failures do
+ group_sibbling = create(:group, parent: group)
+ group_sibbling.add_owner(user)
+
+ visit group_group_members_path(group_within_hierarchy)
+
+ click_on 'Invite a group'
+ click_on 'Select a group'
+ wait_for_requests
+
+ page.within('[data-testid="group-select-dropdown"]') do
+ expect(page).to have_selector("[entity-id='#{group_outside_hierarchy.id}']")
+ expect(page).to have_selector("[entity-id='#{group_sibbling.id}']")
+ expect(page).not_to have_selector("[entity-id='#{group.id}']")
+ expect(page).not_to have_selector("[entity-id='#{group_within_hierarchy.id}']")
+ end
+ end
+ end
+
context 'when sharing with groups outside the hierarchy is enabled' do
context 'when the invite members group modal is disabled' do
before do