diff options
Diffstat (limited to 'spec/features/abuse_report_spec.rb')
-rw-r--r-- | spec/features/abuse_report_spec.rb | 120 |
1 files changed, 33 insertions, 87 deletions
diff --git a/spec/features/abuse_report_spec.rb b/spec/features/abuse_report_spec.rb index f1df5c2d6f0..eac29b0b741 100644 --- a/spec/features/abuse_report_spec.rb +++ b/spec/features/abuse_report_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' RSpec.describe 'Abuse reports', :js, feature_category: :insider_threat do - let_it_be(:abusive_user) { create(:user, :no_super_sidebar) } + let_it_be(:abusive_user) { create(:user) } - let_it_be(:reporter1) { create(:user, :no_super_sidebar) } + let_it_be(:reporter1) { create(:user) } let_it_be(:project) { create(:project, :public, :repository) } let_it_be(:issue) { create(:issue, project: project, author: abusive_user) } @@ -55,103 +55,53 @@ RSpec.describe 'Abuse reports', :js, feature_category: :insider_threat do it_behaves_like 'reports the user with an abuse category' end - describe 'when user_profile_overflow_menu FF turned on' do - context 'when reporting a user profile for abuse' do - let_it_be(:reporter2) { create(:user, :no_super_sidebar) } + context 'when reporting a user profile for abuse' do + let_it_be(:reporter2) { create(:user) } - before do - visit user_path(abusive_user) - find_by_testid('base-dropdown-toggle').click - end - - it_behaves_like 'reports the user with an abuse category' - - it 'allows the reporter to report the same user for different abuse categories' do - visit user_path(abusive_user) - - find_by_testid('base-dropdown-toggle').click - fill_and_submit_abuse_category_form - fill_and_submit_report_abuse_form - - expect(page).to have_content 'Thank you for your report' - - visit user_path(abusive_user) - - find_by_testid('base-dropdown-toggle').click - fill_and_submit_abuse_category_form("They're being offensive or abusive.") - fill_and_submit_report_abuse_form - - expect(page).to have_content 'Thank you for your report' - end - - it 'allows multiple users to report the same user' do - fill_and_submit_abuse_category_form - fill_and_submit_report_abuse_form - - expect(page).to have_content 'Thank you for your report' - - gitlab_sign_out - gitlab_sign_in(reporter2) - - visit user_path(abusive_user) - - find_by_testid('base-dropdown-toggle').click - fill_and_submit_abuse_category_form - fill_and_submit_report_abuse_form - - expect(page).to have_content 'Thank you for your report' - end - - it_behaves_like 'cancel report' + before do + visit user_path(abusive_user) + find_by_testid('user-profile-actions').click end - end - - describe 'when user_profile_overflow_menu FF turned off' do - context 'when reporting a user profile for abuse' do - let_it_be(:reporter2) { create(:user, :no_super_sidebar) } - before do - stub_feature_flags(user_profile_overflow_menu_vue: false) - visit user_path(abusive_user) - end - - it_behaves_like 'reports the user with an abuse category' - - it 'allows the reporter to report the same user for different abuse categories' do - visit user_path(abusive_user) + it_behaves_like 'reports the user with an abuse category' - fill_and_submit_abuse_category_form - fill_and_submit_report_abuse_form + it 'allows the reporter to report the same user for different abuse categories' do + visit user_path(abusive_user) - expect(page).to have_content 'Thank you for your report' + find_by_testid('user-profile-actions').click + fill_and_submit_abuse_category_form + fill_and_submit_report_abuse_form - visit user_path(abusive_user) + expect(page).to have_content 'Thank you for your report' - fill_and_submit_abuse_category_form("They're being offensive or abusive.") - fill_and_submit_report_abuse_form + visit user_path(abusive_user) - expect(page).to have_content 'Thank you for your report' - end + find_by_testid('user-profile-actions').click + fill_and_submit_abuse_category_form("They're being offensive or abusive.") + fill_and_submit_report_abuse_form - it 'allows multiple users to report the same user' do - fill_and_submit_abuse_category_form - fill_and_submit_report_abuse_form + expect(page).to have_content 'Thank you for your report' + end - expect(page).to have_content 'Thank you for your report' + it 'allows multiple users to report the same user', :js do + fill_and_submit_abuse_category_form + fill_and_submit_report_abuse_form - gitlab_sign_out - gitlab_sign_in(reporter2) + expect(page).to have_content 'Thank you for your report' - visit user_path(abusive_user) + gitlab_sign_out + gitlab_sign_in(reporter2) - fill_and_submit_abuse_category_form - fill_and_submit_report_abuse_form + visit user_path(abusive_user) - expect(page).to have_content 'Thank you for your report' - end + find_by_testid('user-profile-actions').click + fill_and_submit_abuse_category_form + fill_and_submit_report_abuse_form - it_behaves_like 'cancel report' + expect(page).to have_content 'Thank you for your report' end + + it_behaves_like 'cancel report' end context 'when reporting an merge request for abuse' do @@ -180,10 +130,6 @@ RSpec.describe 'Abuse reports', :js, feature_category: :insider_threat do end end - # TODO: implement tests before the FF "user_profile_overflow_menu_vue" is turned on - # See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122971 - # Related Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/416983 - private def fill_and_submit_abuse_category_form(category = "They're posting spam.") |