|
64 | 64 | then_the_parent_doesnt_receive_a_consent_request |
65 | 65 | end |
66 | 66 |
|
| 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 | + |
67 | 94 | scenario "record a patient born before January 2020 as already had their 1st MMR dose outside the school session" do |
68 | 95 | given_an_mmr_programme_with_a_session |
69 | 96 | and_a_patient_is_in_the_session_born_before_january_2020 |
@@ -341,4 +368,26 @@ def and_the_consent_requests_are_sent |
341 | 368 | def then_the_parent_doesnt_receive_a_consent_request |
342 | 369 | expect(EmailDeliveryJob.deliveries).to be_empty |
343 | 370 | 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 |
344 | 393 | end |
0 commit comments