diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/features/projects/members/tabs_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/features/projects/members/tabs_spec.rb')
-rw-r--r-- | spec/features/projects/members/tabs_spec.rb | 99 |
1 files changed, 69 insertions, 30 deletions
diff --git a/spec/features/projects/members/tabs_spec.rb b/spec/features/projects/members/tabs_spec.rb index bdcf02c82a4..eef3395de91 100644 --- a/spec/features/projects/members/tabs_spec.rb +++ b/spec/features/projects/members/tabs_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' RSpec.describe 'Projects > Members > Tabs' do + include Spec::Support::Helpers::Features::MembersHelpers using RSpec::Parameterized::TableSyntax let_it_be(:user) { create(:user) } @@ -19,55 +20,93 @@ RSpec.describe 'Projects > Members > Tabs' do end end - before do - allow(Kaminari.config).to receive(:default_per_page).and_return(1) - - sign_in(user) - visit project_project_members_path(project) - end + context 'tabs' do + before do + sign_in(user) + visit project_project_members_path(project) + end - where(:tab, :count) do - 'Members' | 3 - 'Invited' | 2 - 'Groups' | 2 - 'Access requests' | 2 - end + where(:tab, :count) do + 'Members' | 3 + 'Invited' | 2 + 'Groups' | 2 + 'Access requests' | 2 + end - with_them do - it "renders #{params[:tab]} tab" do - expect(page).to have_selector('.nav-link', text: "#{tab} #{count}") + with_them do + it "renders #{params[:tab]} tab" do + expect(page).to have_selector('.nav-link', text: "#{tab} #{count}") + end end - end - context 'displays "Members" tab by default' do - it_behaves_like 'active "Members" tab' + context 'displays "Members" tab by default' do + it_behaves_like 'active "Members" tab' + end end - context 'when searching "Groups"', :js do + context 'when `vue_project_members_list` feature flag is enabled' do before do - click_link 'Groups' + sign_in(user) + visit project_project_members_path(project) + end + + context 'when searching "Groups"', :js do + before do + click_link 'Groups' + + fill_in_filtered_search 'Search groups', with: 'group' + end - page.within '[data-testid="group-link-search-form"]' do - fill_in 'search_groups', with: 'group' - find('button[type="submit"]').click + it 'displays "Groups" tab' do + expect(page).to have_selector('.nav-link.active', text: 'Groups') + end + + context 'and then searching "Members"' do + before do + click_link 'Members 3' + + fill_in_filtered_search 'Filter members', with: 'user' + end + + it_behaves_like 'active "Members" tab' end end + end + + context 'when `vue_project_members_list` feature flag is disabled' do + before do + stub_feature_flags(vue_project_members_list: false) - it 'displays "Groups" tab' do - expect(page).to have_selector('.nav-link.active', text: 'Groups') + sign_in(user) + visit project_project_members_path(project) end - context 'and then searching "Members"' do + context 'when searching "Groups"', :js do before do - click_link 'Members 3' + click_link 'Groups' - page.within '[data-testid="user-search-form"]' do - fill_in 'search', with: 'user' + page.within '[data-testid="group-link-search-form"]' do + fill_in 'search_groups', with: 'group' find('button[type="submit"]').click end end - it_behaves_like 'active "Members" tab' + it 'displays "Groups" tab' do + expect(page).to have_selector('.nav-link.active', text: 'Groups') + end + + context 'and then searching "Members"' do + before do + click_link 'Members 3' + + page.within '[data-testid="user-search-form"]' do + fill_in 'search', with: 'user' + find('button[type="submit"]').click + end + end + + it_behaves_like 'active "Members" tab' + end end end end |