Skip to content

Commit 69cfb69

Browse files
Show banner on dates <= cutoff instead of only == cutoff
Users won't be given access until near the date, and if they log on a bit early, then it'll still be useful information for them. Jira-Issue: MAV-5301
1 parent 961b505 commit 69cfb69

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

app/views/immunisation_imports/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<% content_for :page_title, title %>
88

9-
<% if (cutoff_date = current_team.national_reporting_cut_off_date) && cutoff_date.today? %>
9+
<% if (cutoff_date = current_team.national_reporting_cut_off_date) && Date.today <= cutoff_date %>
1010
<%= govuk_notification_banner(title_text: "Important") do %>
1111
<h3 class="nhsuk-notification-banner__heading">
1212
Mavis national reporting replaces NIVS on <%= cutoff_date.to_fs(:long) %>

spec/features/import_vaccination_records_national_reporting_spec.rb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
context "cutoff date banner" do
5757
let(:cutoff_date) { Date.new(2026, 4, 20) }
5858

59-
context "when today is not the cutoff date" do
60-
around { |example| travel_to(cutoff_date - 1.day) { example.run } }
59+
context "when today is after the cutoff date" do
60+
around { |example| travel_to(cutoff_date + 1.day) { example.run } }
6161

6262
scenario "banner is not shown" do
6363
given_mavis_logins_are_configured(
@@ -69,6 +69,22 @@
6969
end
7070
end
7171

72+
context "when today is before the cutoff date" do
73+
around { |example| travel_to(cutoff_date - 1.day) { example.run } }
74+
75+
scenario "banner is shown" do
76+
given_mavis_logins_are_configured(
77+
national_reporting_cut_off_date: cutoff_date
78+
)
79+
given_i_am_signed_in_as_a_national_reporting_user
80+
when_i_navigate_to_the_upload_page
81+
expect(page).to have_css(".nhsuk-notification-banner")
82+
expect(page).to have_content(
83+
"Mavis national reporting replaces NIVS on 20 April 2026"
84+
)
85+
end
86+
end
87+
7288
context "when today is the cutoff date" do
7389
around { |example| travel_to(cutoff_date) { example.run } }
7490

0 commit comments

Comments
 (0)