From 463f9197d822e3b040834b4dab1c5334c7c8b968 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 4 Oct 2024 08:21:55 -0400 Subject: [PATCH] Add regression coverage for admin reports resolution button within form (#32248) --- spec/system/report_interface_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/system/report_interface_spec.rb b/spec/system/report_interface_spec.rb index 257a1cd6fd..6a90aa5bc6 100644 --- a/spec/system/report_interface_spec.rb +++ b/spec/system/report_interface_spec.rb @@ -28,4 +28,17 @@ RSpec.describe 'report interface', :attachment_processing, :js, :streaming do page.scroll_to(page.find('.batch-table__row')) expect(page).to have_css('.spoiler-button__overlay__label') end + + it 'marks a report resolved from the show page actions area' do + visit admin_report_path(report) + + expect { resolve_report } + .to change { report.reload.action_taken_at }.to(be_present).from(nil) + end + + def resolve_report + within '.report-actions' do + click_on I18n.t('admin.reports.mark_as_resolved') + end + end end