From 690cfb3b98d1074948045053cea081acd2bf586d Mon Sep 17 00:00:00 2001 From: Ryan Brown Date: Wed, 18 Dec 2024 14:44:18 +0000 Subject: [PATCH] Provide a reminder of the review date on the review date deletion confirmation screen --- app/views/admin/review_reminders/confirm_destroy.html.erb | 1 + features/review_reminder.feature | 3 ++- features/step_definitions/review_reminder_steps.rb | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/admin/review_reminders/confirm_destroy.html.erb b/app/views/admin/review_reminders/confirm_destroy.html.erb index 1951ff9aa39..37b2daec21a 100644 --- a/app/views/admin/review_reminders/confirm_destroy.html.erb +++ b/app/views/admin/review_reminders/confirm_destroy.html.erb @@ -5,6 +5,7 @@
+

Review date: <%= @review_reminder.review_at.strftime("%-d %B %Y") %>

<%= form_tag admin_document_review_reminder_path(@document, @review_reminder), method: :delete do %>

Are you sure you want to delete this review reminder?

diff --git a/features/review_reminder.feature b/features/review_reminder.feature index 2fe6585a45a..3c23c19d7c6 100644 --- a/features/review_reminder.feature +++ b/features/review_reminder.feature @@ -29,5 +29,6 @@ Feature: Review reminders And The delete review reminder feature flag is "enabled" And a review reminder exists for "Standard Beard Lengths" with the date "2032-1-1" When I click the link "Delete review date" on the edition summary page for "Standard Beard Lengths" - And I delete the review date + Then I should see the review date of "1 January 2032" on the deletion confirmation page + When I delete the review date Then I should not see a review date on the edition summary page diff --git a/features/step_definitions/review_reminder_steps.rb b/features/step_definitions/review_reminder_steps.rb index 55d4369a427..98793759419 100644 --- a/features/step_definitions/review_reminder_steps.rb +++ b/features/step_definitions/review_reminder_steps.rb @@ -24,6 +24,10 @@ assert_selector ".app-view-summary__section .govuk-summary-list__row:nth-child(5) .govuk-summary-list__value", text: date end +Then(/^I should see the review date of "([^"]*)" on the deletion confirmation page$/) do |date| + assert_selector ".govuk-body", text: "Review date: #{date}" +end + Then(/^I should not see a review date on the edition summary page$/) do assert_selector ".app-view-summary__section .govuk-summary-list__row:nth-child(5) .govuk-summary-list__key", text: "Review date" assert_selector ".app-view-summary__section .govuk-summary-list__row:nth-child(5) .govuk-summary-list__value", text: "Not set"