summaryrefslogtreecommitdiff
path: root/spec/features/groups
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/groups')
-rw-r--r--spec/features/groups/board_spec.rb4
-rw-r--r--spec/features/groups/clusters/user_spec.rb2
-rw-r--r--spec/features/groups/empty_states_spec.rb8
-rw-r--r--spec/features/groups/group_runners_spec.rb13
-rw-r--r--spec/features/groups/group_settings_spec.rb2
-rw-r--r--spec/features/groups/merge_requests_spec.rb8
-rw-r--r--spec/features/groups/settings/packages_and_registries_spec.rb2
-rw-r--r--spec/features/groups/show_spec.rb56
8 files changed, 56 insertions, 39 deletions
diff --git a/spec/features/groups/board_spec.rb b/spec/features/groups/board_spec.rb
index 11ec38f637b..c451a97bed5 100644
--- a/spec/features/groups/board_spec.rb
+++ b/spec/features/groups/board_spec.rb
@@ -14,6 +14,8 @@ RSpec.describe 'Group Boards', feature_category: :team_planning do
let_it_be(:project) { create(:project_empty_repo, group: group) }
before do
+ stub_feature_flags(apollo_boards: false)
+
group.add_maintainer(user)
sign_in(user)
@@ -60,6 +62,8 @@ RSpec.describe 'Group Boards', feature_category: :team_planning do
let_it_be(:issue2) { create(:issue, title: 'issue2', project: project2) }
before do
+ stub_feature_flags(apollo_boards: false)
+
project1.add_guest(user)
project2.add_reporter(user)
diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb
index 3e565dd8eab..d876a5804bd 100644
--- a/spec/features/groups/clusters/user_spec.rb
+++ b/spec/features/groups/clusters/user_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'User Cluster', :js, feature_category: :users do
+RSpec.describe 'User Cluster', :js, feature_category: :user_profile do
include GoogleApi::CloudPlatformHelpers
let(:group) { create(:group) }
diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb
index a37c40f50e0..e123e223ae5 100644
--- a/spec/features/groups/empty_states_spec.rb
+++ b/spec/features/groups/empty_states_spec.rb
@@ -98,13 +98,9 @@ RSpec.describe 'Group empty states', feature_category: :subgroups do
end
it "the new #{issuable_name} button opens a project dropdown" do
- click_button 'Toggle project select'
+ click_button "Select project to create #{issuable_name}"
- if issuable == :issue
- expect(page).to have_button project.name
- else
- expect(page).to have_selector('.ajax-project-dropdown')
- end
+ expect(page).to have_button project.name
end
end
end
diff --git a/spec/features/groups/group_runners_spec.rb b/spec/features/groups/group_runners_spec.rb
index ab53ef7c470..ae757e04716 100644
--- a/spec/features/groups/group_runners_spec.rb
+++ b/spec/features/groups/group_runners_spec.rb
@@ -203,15 +203,24 @@ RSpec.describe "Group Runners", feature_category: :runner_fleet do
end
describe "Group runner show page", :js do
- let!(:group_runner) do
+ let_it_be(:group_runner) do
create(:ci_runner, :group, groups: [group], description: 'runner-foo')
end
- it 'user views runner details' do
+ let_it_be(:group_runner_job) { create(:ci_build, runner: group_runner) }
+
+ before do
visit group_runner_path(group, group_runner)
+ end
+ it 'user views runner details' do
expect(page).to have_content "#{s_('Runners|Description')} runner-foo"
end
+
+ it_behaves_like 'shows runner jobs tab' do
+ let(:job_count) { '1' }
+ let(:job) { group_runner_job }
+ end
end
describe "Group runner edit page", :js do
diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb
index fe1b0909c06..5510e73ef0f 100644
--- a/spec/features/groups/group_settings_spec.rb
+++ b/spec/features/groups/group_settings_spec.rb
@@ -162,7 +162,7 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do
page.within(confirm_modal) do
expect(page).to have_text "You are going to transfer #{selected_group.name} to another namespace. Are you ABSOLUTELY sure?"
- fill_in 'confirm_name_input', with: selected_group.name
+ fill_in 'confirm_name_input', with: selected_group.full_path
click_button 'Confirm'
end
diff --git a/spec/features/groups/merge_requests_spec.rb b/spec/features/groups/merge_requests_spec.rb
index 8a3401d0572..bbb7d322b9a 100644
--- a/spec/features/groups/merge_requests_spec.rb
+++ b/spec/features/groups/merge_requests_spec.rb
@@ -77,9 +77,9 @@ RSpec.describe 'Group merge requests page', feature_category: :code_review_workf
end
it 'shows projects only with merge requests feature enabled', :js do
- find('.js-new-project-item-link').click
+ click_button 'Select project to create merge request'
- page.within('.select2-results') do
+ page.within('[data-testid="new-resource-dropdown"]') do
expect(page).to have_content(project.name_with_namespace)
expect(page).not_to have_content(project_with_merge_requests_disabled.name_with_namespace)
end
@@ -95,7 +95,7 @@ RSpec.describe 'Group merge requests page', feature_category: :code_review_workf
visit path
expect(page).to have_selector('.empty-state')
- expect(page).to have_link('Select project to create merge request')
+ expect(page).to have_button('Select project to create merge request')
expect(page).to have_selector('.issues-filters')
end
@@ -105,7 +105,7 @@ RSpec.describe 'Group merge requests page', feature_category: :code_review_workf
visit path
expect(page).to have_selector('.empty-state')
- expect(page).to have_link('Select project to create merge request')
+ expect(page).to have_button('Select project to create merge request')
expect(page).to have_selector('.issues-filters')
end
end
diff --git a/spec/features/groups/settings/packages_and_registries_spec.rb b/spec/features/groups/settings/packages_and_registries_spec.rb
index 60aad8452ce..80e2dcd5174 100644
--- a/spec/features/groups/settings/packages_and_registries_spec.rb
+++ b/spec/features/groups/settings/packages_and_registries_spec.rb
@@ -46,7 +46,7 @@ RSpec.describe 'Group Package and registry settings', feature_category: :package
it 'has a page title set' do
visit_settings_page
- expect(page).to have_title _('Package and registry settings')
+ expect(page).to have_title _('Packages and registries settings')
end
it 'sidebar menu is open' do
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb
index c0af6080d0f..5cab79b40cf 100644
--- a/spec/features/groups/show_spec.rb
+++ b/spec/features/groups/show_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe 'Group show page', feature_category: :subgroups do
+ include Spec::Support::Helpers::Features::InviteMembersModalHelper
+
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
@@ -37,6 +39,16 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
expect(page).to have_content('Collaborate with your team')
page.within(find('[data-testid="invite-members-banner"]')) do
+ click_button('Invite your colleagues')
+ end
+
+ page.within(invite_modal_selector) do
+ expect(page).to have_content("You're inviting members to the #{group.name} group")
+
+ click_button('Cancel')
+ end
+
+ page.within(find('[data-testid="invite-members-banner"]')) do
find('[data-testid="close-icon"]').click
end
@@ -73,7 +85,7 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
end
end
- context 'subgroups and projects empty state', :js do
+ context 'with subgroups and projects empty state', :js do
context 'when user has permissions to create new subgroups or projects' do
before do
group.add_owner(user)
@@ -82,22 +94,19 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
end
it 'shows `Create new subgroup` link' do
- expect(page).to have_link(
- s_('GroupsEmptyState|Create new subgroup'),
- href: new_group_path(parent_id: group.id, anchor: 'create-group-pane')
- )
+ link = new_group_path(parent_id: group.id, anchor: 'create-group-pane')
+
+ expect(page).to have_link(s_('GroupsEmptyState|Create new subgroup'), href: link)
end
it 'shows `Create new project` link' do
- expect(page).to have_link(
- s_('GroupsEmptyState|Create new project'),
- href: new_project_path(namespace_id: group.id)
- )
+ expect(page)
+ .to have_link(s_('GroupsEmptyState|Create new project'), href: new_project_path(namespace_id: group.id))
end
end
end
- context 'visibility warning popover' do
+ context 'with visibility warning popover' do
let_it_be(:public_project) { create(:project, :public) }
shared_examples 'it shows warning popover' do
@@ -145,23 +154,22 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
end
it 'does not show `Create new subgroup` link' do
- expect(page).not_to have_link(
- s_('GroupsEmptyState|Create new subgroup'),
- href: new_group_path(parent_id: group.id)
- )
+ expect(page)
+ .not_to have_link(s_('GroupsEmptyState|Create new subgroup'), href: new_group_path(parent_id: group.id))
end
it 'does not show `Create new project` link' do
- expect(page).not_to have_link(
- s_('GroupsEmptyState|Create new project'),
- href: new_project_path(namespace_id: group.id)
- )
+ expect(page)
+ .not_to have_link(s_('GroupsEmptyState|Create new project'), href: new_project_path(namespace_id: group.id))
end
it 'shows empty state' do
+ content = s_('GroupsEmptyState|You do not have necessary permissions to create a subgroup ' \
+ 'or project in this group. Please contact an owner of this group to create a ' \
+ 'new subgroup or project.')
+
expect(page).to have_content(s_('GroupsEmptyState|No subgroups or projects.'))
- expect(page).to have_content(s_('GroupsEmptyState|You do not have necessary permissions to create a subgroup' \
- ' or project in this group. Please contact an owner of this group to create a new subgroup or project.'))
+ expect(page).to have_content(content)
end
end
end
@@ -198,7 +206,7 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
end
end
- context 'subgroup support' do
+ context 'with subgroup support' do
let_it_be(:restricted_group) do
create(:group, subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS)
end
@@ -255,7 +263,7 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
end
end
- context 'notification button', :js do
+ context 'for notification button', :js do
before do
group.add_maintainer(user)
sign_in(user)
@@ -276,7 +284,7 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
end
end
- context 'page og:description' do
+ context 'for page og:description' do
before do
group.update!(description: '**Lorem** _ipsum_ dolor sit [amet](https://example.com)')
group.add_maintainer(user)
@@ -287,7 +295,7 @@ RSpec.describe 'Group show page', feature_category: :subgroups do
it_behaves_like 'page meta description', 'Lorem ipsum dolor sit amet'
end
- context 'structured schema markup' do
+ context 'for structured schema markup' do
let_it_be(:group) { create(:group, :public, :with_avatar, description: 'foo') }
let_it_be(:subgroup) { create(:group, :public, :with_avatar, parent: group, description: 'bar') }
let_it_be_with_reload(:project) { create(:project, :public, :with_avatar, namespace: group, description: 'foo') }