diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/features/groups/members/filter_members_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/features/groups/members/filter_members_spec.rb')
-rw-r--r-- | spec/features/groups/members/filter_members_spec.rb | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/spec/features/groups/members/filter_members_spec.rb b/spec/features/groups/members/filter_members_spec.rb index d667690af29..b6d33b3f4aa 100644 --- a/spec/features/groups/members/filter_members_spec.rb +++ b/spec/features/groups/members/filter_members_spec.rb @@ -2,16 +2,19 @@ require 'spec_helper' -RSpec.describe 'Groups > Members > Filter members' do +RSpec.describe 'Groups > Members > Filter members', :js do + include Spec::Support::Helpers::Features::MembersHelpers + let(:user) { create(:user) } let(:nested_group_user) { create(:user) } let(:user_with_2fa) { create(:user, :two_factor_via_otp) } let(:group) { create(:group) } let(:nested_group) { create(:group, parent: group) } - before do - stub_feature_flags(vue_group_members_list: false) + two_factor_auth_dropdown_toggle_selector = '[data-testid="member-filter-2fa-dropdown"] [data-testid="dropdown-toggle"]' + active_inherited_members_filter_selector = '[data-testid="filter-members-with-inherited-permissions"] a.is-active' + before do group.add_owner(user) group.add_maintainer(user_with_2fa) nested_group.add_maintainer(nested_group_user) @@ -24,23 +27,23 @@ RSpec.describe 'Groups > Members > Filter members' do expect(member(0)).to include(user.name) expect(member(1)).to include(user_with_2fa.name) - expect(page).to have_css('.member-filter-2fa-dropdown .dropdown-toggle-text', text: 'Everyone') + expect(page).to have_css(two_factor_auth_dropdown_toggle_selector, text: 'Everyone') end it 'shows only 2FA members' do visit_members_list(group, two_factor: 'enabled') expect(member(0)).to include(user_with_2fa.name) - expect(members_list.size).to eq(1) - expect(page).to have_css('.member-filter-2fa-dropdown .dropdown-toggle-text', text: 'Enabled') + expect(all_rows.size).to eq(1) + expect(page).to have_css(two_factor_auth_dropdown_toggle_selector, text: 'Enabled') end it 'shows only non 2FA members' do visit_members_list(group, two_factor: 'disabled') expect(member(0)).to include(user.name) - expect(members_list.size).to eq(1) - expect(page).to have_css('.member-filter-2fa-dropdown .dropdown-toggle-text', text: 'Disabled') + expect(all_rows.size).to eq(1) + expect(page).to have_css(two_factor_auth_dropdown_toggle_selector, text: 'Disabled') end it 'shows inherited members by default' do @@ -49,35 +52,31 @@ RSpec.describe 'Groups > Members > Filter members' do expect(member(0)).to include(user.name) expect(member(1)).to include(user_with_2fa.name) expect(member(2)).to include(nested_group_user.name) - expect(members_list.size).to eq(3) + expect(all_rows.size).to eq(3) - expect(page).to have_css('[data-qa-selector="filter-members-with-inherited-permissions"] a.is-active', text: 'Show all members') + expect(page).to have_css(active_inherited_members_filter_selector, text: 'Show all members', visible: false) end it 'shows only group members' do visit_members_list(nested_group, with_inherited_permissions: 'exclude') expect(member(0)).to include(nested_group_user.name) - expect(members_list.size).to eq(1) - expect(page).to have_css('[data-qa-selector="filter-members-with-inherited-permissions"] a.is-active', text: 'Show only direct members') + expect(all_rows.size).to eq(1) + expect(page).to have_css(active_inherited_members_filter_selector, text: 'Show only direct members', visible: false) end it 'shows only inherited members' do visit_members_list(nested_group, with_inherited_permissions: 'only') expect(member(0)).to include(user.name) expect(member(1)).to include(user_with_2fa.name) - expect(members_list.size).to eq(2) - expect(page).to have_css('[data-qa-selector="filter-members-with-inherited-permissions"] a.is-active', text: 'Show only inherited members') + expect(all_rows.size).to eq(2) + expect(page).to have_css(active_inherited_members_filter_selector, text: 'Show only inherited members', visible: false) end def visit_members_list(group, options = {}) visit group_group_members_path(group.to_param, options) end - def members_list - page.all('ul.content-list > li') - end - def member(number) - members_list[number].text + all_rows[number].text end end |