diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 00:09:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 00:09:18 +0300 |
commit | ab5672c13d7fe5c79fdeac10e7505187cf4ba606 (patch) | |
tree | eb7036d6e4c8ce64c58f18185eced3a5e315c099 /spec/features/admin | |
parent | d23f33082ad893fad172b17f1ce66bd847671d56 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/admin')
-rw-r--r-- | spec/features/admin/admin_abuse_reports_spec.rb | 45 | ||||
-rw-r--r-- | spec/features/admin/admin_labels_spec.rb | 7 |
2 files changed, 46 insertions, 6 deletions
diff --git a/spec/features/admin/admin_abuse_reports_spec.rb b/spec/features/admin/admin_abuse_reports_spec.rb index 9fe72b981f1..9739ea53f81 100644 --- a/spec/features/admin/admin_abuse_reports_spec.rb +++ b/spec/features/admin/admin_abuse_reports_spec.rb @@ -143,24 +143,61 @@ RSpec.describe "Admin::AbuseReports", :js, feature_category: :shared do end describe 'if a user has been reported for abuse' do - let!(:abuse_report) { create(:abuse_report, user: user) } + let_it_be(:abuse_report) { create(:abuse_report, user: user) } describe 'in the abuse report view' do - it 'presents information about abuse report' do + before do visit admin_abuse_reports_path + end + it 'presents information about abuse report' do expect(page).to have_content('Abuse Reports') + + expect(page).to have_content(user.name) + expect(page).to have_content(abuse_report.reporter.name) expect(page).to have_content(abuse_report.message) expect(page).to have_link(user.name, href: user_path(user)) + end + + it 'present actions items' do + expect(page).to have_link('Remove user & report') + expect(page).to have_link('Block user') expect(page).to have_link('Remove user') end end describe 'in the profile page of the user' do - it 'shows a link to the admin view of the user' do + it 'shows a link to view user in the admin area' do visit user_path(user) - expect(page).to have_link '', href: admin_user_path(user) + expect(page).to have_link 'View user in admin area', href: admin_user_path(user) + end + end + end + + describe 'if an admin has been reported for abuse' do + let_it_be(:admin_abuse_report) { create(:abuse_report, user: admin) } + + describe 'in the abuse report view' do + before do + visit admin_abuse_reports_path + end + + it 'presents information about abuse report' do + page.within(:table_row, { "User" => admin.name }) do + expect(page).to have_content(admin.name) + expect(page).to have_content(admin_abuse_report.reporter.name) + expect(page).to have_content(admin_abuse_report.message) + expect(page).to have_link(admin.name, href: user_path(admin)) + end + end + + it 'does not present actions items' do + page.within(:table_row, { "User" => admin.name }) do + expect(page).not_to have_link('Remove user & report') + expect(page).not_to have_link('Block user') + expect(page).not_to have_link('Remove user') + end end end end diff --git a/spec/features/admin/admin_labels_spec.rb b/spec/features/admin/admin_labels_spec.rb index 8d2813d26f7..68d63ac321e 100644 --- a/spec/features/admin/admin_labels_spec.rb +++ b/spec/features/admin/admin_labels_spec.rb @@ -37,8 +37,11 @@ RSpec.describe 'admin issues labels', feature_category: :team_planning do end it 'deletes all labels', :js do - page.all('.labels .js-remove-label').each do |remove| - accept_gl_confirm(button_text: 'Delete label') { remove.click } + page.all('.labels .label-actions-list').each do |label| + label.click + accept_gl_confirm(button_text: 'Delete label') do + click_link 'Delete' + end wait_for_requests end |