summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-09 18:09:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-09 18:09:11 +0000
commitd23f33082ad893fad172b17f1ce66bd847671d56 (patch)
treebdffb3f1a3f4855d2a9a7f8762f2812366c75a41 /spec/features
parent3670ddd229b178c0a2e09a1466ddfd7fd2f7855d (diff)
downloadgitlab-ce-d23f33082ad893fad172b17f1ce66bd847671d56.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/admin/admin_settings_spec.rb26
-rw-r--r--spec/features/nav/pinned_nav_items_spec.rb30
-rw-r--r--spec/features/profiles/chat_names_spec.rb25
3 files changed, 69 insertions, 12 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb
index 4dee97880a5..8f687332901 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/spec/features/admin/admin_settings_spec.rb
@@ -360,8 +360,8 @@ RSpec.describe 'Admin updates settings', feature_category: :shared do
end
end
- context 'GitLab for Jira App settings' do
- it 'changes the setting' do
+ context 'GitLab for Jira App settings', feature_category: :integrations do
+ it 'changes the settings' do
page.within('#js-jira_connect-settings') do
fill_in 'Jira Connect Application ID', with: '1234'
fill_in 'Jira Connect Proxy URL', with: 'https://example.com'
@@ -375,6 +375,28 @@ RSpec.describe 'Admin updates settings', feature_category: :shared do
expect(page).to have_content "Application settings saved successfully"
end
end
+
+ context 'GitLab for Slack app settings', feature_category: :integrations do
+ it 'changes the settings' do
+ page.within('.as-slack') do
+ check 'Enable Slack application'
+ fill_in 'Client ID', with: 'slack_app_id'
+ fill_in 'Client secret', with: 'slack_app_secret'
+ fill_in 'Signing secret', with: 'slack_app_signing_secret'
+ fill_in 'Verification token', with: 'slack_app_verification_token'
+ click_button 'Save changes'
+ end
+
+ expect(current_settings).to have_attributes(
+ slack_app_enabled: true,
+ slack_app_id: 'slack_app_id',
+ slack_app_secret: 'slack_app_secret',
+ slack_app_signing_secret: 'slack_app_signing_secret',
+ slack_app_verification_token: 'slack_app_verification_token'
+ )
+ expect(page).to have_content 'Application settings saved successfully'
+ end
+ end
end
context 'Integrations page' do
diff --git a/spec/features/nav/pinned_nav_items_spec.rb b/spec/features/nav/pinned_nav_items_spec.rb
index ea0404e7cf6..308350d5166 100644
--- a/spec/features/nav/pinned_nav_items_spec.rb
+++ b/spec/features/nav/pinned_nav_items_spec.rb
@@ -35,6 +35,12 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
visit project_path(project)
end
+ it 'adds sensible defaults' do
+ within '[data-testid="pinned-nav-items"]' do
+ expect(page).to have_link 'Issues'
+ end
+ end
+
it 'shows the Pinned section' do
within '#super-sidebar' do
expect(page).to have_content 'Pinned'
@@ -49,12 +55,17 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
end
within '[data-testid="pinned-nav-items"]' do
+ expect(page).to have_link 'Issues'
expect(page).to have_link 'Activity'
expect(page).to have_link 'Members'
end
end
- describe 'collapsible section' do
+ describe 'when all pins are removed' do
+ before do
+ remove_pin('Issues')
+ end
+
it 'shows the Pinned section as expanded by default' do
within '#super-sidebar' do
expect(page).to have_content 'Your pinned items appear here.'
@@ -106,14 +117,13 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
it 'can be reordered' do
within '[data-testid="pinned-nav-items"]' do
pinned_items = page.find_all('a').map(&:text)
- item1 = page.find('a', text: 'Package Registry')
- item2 = page.find('a', text: 'Terraform modules')
- expect(pinned_items).to eq [item1.text, item2.text]
-
- drag_item(item2, to: item1)
+ item2 = page.find('a', text: 'Package Registry')
+ item3 = page.find('a', text: 'Terraform modules')
+ expect(pinned_items[1..2]).to eq [item2.text, item3.text]
+ drag_item(item3, to: item2)
pinned_items = page.find_all('a').map(&:text)
- expect(pinned_items).to eq [item2.text, item1.text]
+ expect(pinned_items[1..2]).to eq [item3.text, item2.text]
end
end
end
@@ -148,8 +158,10 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
it 'keeps pins of non-available features' do
within '[data-testid="pinned-nav-items"]' do
- pinned_items = page.find_all('a').map(&:text)
- expect(pinned_items).to eq %w[Commits Members Activity]
+ pinned_items = page.find_all('a')
+ .map(&:text)
+ .map { |text| text.split("\n").first } # to drop the counter badge text from "Issues\n0"
+ expect(pinned_items).to eq ["Issues", "Merge requests", "Commits", "Members", "Activity"]
end
end
end
diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb
index 105d7d4ec16..aa3f4a90298 100644
--- a/spec/features/profiles/chat_names_spec.rb
+++ b/spec/features/profiles/chat_names_spec.rb
@@ -26,13 +26,36 @@ RSpec.describe 'Profile > Chat', feature_category: :integrations do
visit authorize_path
end
- it 'names the integration correctly' do
+ it 'names the Mattermost integration correctly' do
expect(page).to have_content(
'An application called Mattermost slash commands is requesting access to your GitLab account'
)
expect(page).to have_content('Authorize Mattermost slash commands')
end
+ context 'when params are of the GitLab for Slack app' do
+ let(:params) do
+ { team_id: 'T00', team_domain: 'my_chat_team', user_id: 'U01', user_name: 'my_chat_user' }
+ end
+
+ shared_examples 'names the GitLab for Slack app integration correctly' do
+ specify do
+ expect(page).to have_content(
+ 'An application called GitLab for Slack app is requesting access to your GitLab account'
+ )
+ expect(page).to have_content('Authorize GitLab for Slack app')
+ end
+ end
+
+ include_examples 'names the GitLab for Slack app integration correctly'
+
+ context 'with a Slack enterprise-enabled team' do
+ let(:params) { super().merge(user_id: 'W01') }
+
+ include_examples 'names the GitLab for Slack app integration correctly'
+ end
+ end
+
context 'clicks authorize' do
before do
click_button 'Authorize'