Skip to content

Commit 3e63737

Browse files
authored
Merge pull request #6024 from nhsuk/fix-already-vaccinated-flow-to-hide-location-question
Don't prompt for location when editing already vaccinated date
2 parents 6f80378 + 7bf9005 commit 3e63737

3 files changed

Lines changed: 50 additions & 8 deletions

File tree

app/models/draft_vaccination_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def wizard_steps
7474
(:dose if administered? && can_be_half_dose?),
7575
(:batch if administered?),
7676
(
77-
if session&.generic_clinic? || national_reporting_user_and_record?
77+
if !already_had? && (session&.generic_clinic? || national_reporting_user_and_record?)
7878
:location
7979
end
8080
),

spec/features/mmr_already_had_spec.rb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,33 @@
6464
then_the_parent_doesnt_receive_a_consent_request
6565
end
6666

67+
scenario "record a patient as already had their 1st MMR dose and then edit dates" do
68+
given_an_mmr_programme_with_a_session
69+
and_a_patient_is_in_the_session_born_after_january_2020
70+
and_the_patient_doesnt_need_triage
71+
and_the_patient_has_not_had_a_first_dose
72+
73+
when_i_go_the_session
74+
then_i_see_one_patient_needing_consent
75+
and_i_click_on_the_patient
76+
then_i_see_the_patient_needs_consent
77+
78+
when_i_click_record_as_already_had_first_dose
79+
then_i_see_the_did_you_have_mmr_or_mmrv_page
80+
81+
when_i_choose_mmr_and_continue
82+
then_i_see_the_mmr_date_page
83+
84+
when_i_fill_in_the_date_and_time_and_continue
85+
then_i_see_the_confirmation_page
86+
87+
when_i_click_link_to_change_the_date
88+
then_i_see_the_mmr_date_page
89+
when_i_change_the_date_and_continue
90+
then_i_see_the_confirmation_page
91+
and_i_see_the_updated_date_in_the_summary
92+
end
93+
6794
scenario "record a patient born before January 2020 as already had their 1st MMR dose outside the school session" do
6895
given_an_mmr_programme_with_a_session
6996
and_a_patient_is_in_the_session_born_before_january_2020
@@ -341,4 +368,26 @@ def and_the_consent_requests_are_sent
341368
def then_the_parent_doesnt_receive_a_consent_request
342369
expect(EmailDeliveryJob.deliveries).to be_empty
343370
end
371+
372+
def when_i_click_link_to_change_the_date
373+
within(".nhsuk-summary-list__actions[contains('Change date')]") do
374+
click_on "Change"
375+
end
376+
end
377+
378+
def when_i_change_the_date_and_continue
379+
@vaccination_date += 1.day
380+
381+
fill_in "Day", with: @vaccination_date.day
382+
fill_in "Month", with: @vaccination_date.month
383+
fill_in "Year", with: @vaccination_date.year
384+
385+
click_on "Continue"
386+
end
387+
388+
def and_i_see_the_updated_date_in_the_summary
389+
expect(page).to have_content(
390+
"Date#{@vaccination_date.strftime("%-d %B %Y")}"
391+
)
392+
end
344393
end

spec/features/td_ipv_already_had_spec.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,9 @@
4545
then_i_see_the_date_page
4646

4747
when_i_fill_in_the_date_and_continue
48-
then_i_see_the_location_page
4948

50-
when_i_fill_in_the_location_and_continue
5149
and_i_confirm_the_details
5250
then_i_see_the_patient_is_already_vaccinated
53-
and_i_see_that_the_location_is_waterloo_hospital
5451
and_the_consent_requests_are_sent
5552
then_the_parent_doesnt_receive_a_consent_request
5653
end
@@ -227,10 +224,6 @@ def and_i_see_that_the_location_is_unknown
227224
expect(page).to have_content("LocationUnknown")
228225
end
229226

230-
def and_i_see_that_the_location_is_waterloo_hospital
231-
expect(page).to have_content("LocationWaterloo Hospital")
232-
end
233-
234227
def and_i_cannot_record_the_patient_as_already_vaccinated
235228
expect(page).not_to have_content("Record as already vaccinated")
236229
end

0 commit comments

Comments
 (0)