1414
1515 when_i_record_vaccination_outcomes_to_the_spreadsheet_and_export_it_to_csv
1616 and_i_upload_the_modified_csv_file
17- then_i_see_there_are_previously_imported_records
17+ then_i_see_there_are_no_previously_imported_records
1818 when_i_navigate_to_the_session_page
1919 then_i_see_the_uploaded_vaccination_outcomes_reflected_in_the_session
2020
3232
3333 when_i_record_vaccination_outcomes_to_the_spreadsheet_and_export_it_to_csv
3434 and_i_upload_the_modified_csv_file
35- then_i_see_there_are_previously_imported_records
35+ then_i_see_there_are_no_previously_imported_records
3636 when_i_navigate_to_the_clinic_page
3737 then_i_see_the_uploaded_vaccination_outcomes_reflected_in_the_session
3838 and_the_clinic_location_is_displayed
5151 and_i_upload_the_modified_csv_file
5252 then_i_see_a_duplicate_record_needs_review
5353
54+ when_i_review_the_duplicate_record
55+ then_i_should_see_the_changes
56+
5457 when_i_choose_to_keep_the_duplicate_record
5558 then_i_should_see_a_success_message
5659 and_the_vaccination_record_is_synced_to_nhs
@@ -189,7 +192,7 @@ def and_alter_an_existing_vaccination_record
189192 @sheet = @workbook [ "Vaccinations" ]
190193 @headers = @sheet [ 0 ] . cells . map ( &:value )
191194
192- array = @workbook [ 0 ] . to_a [ 1 ..] . map ( &:cells ) . map { _1 . map ( &:value ) }
195+ array = @workbook [ 0 ] . to_a [ 1 ..] . map ( &:cells ) . map { it . map ( &:value ) }
193196 csv_table =
194197 CSV ::Table . new (
195198 array . map do |row |
@@ -204,8 +207,21 @@ def and_alter_an_existing_vaccination_record
204207 File . write ( "tmp/modified.csv" , csv_table . to_csv )
205208 end
206209
207- def when_i_choose_to_keep_the_duplicate_record
210+ def when_i_review_the_duplicate_record
208211 click_on "Review"
212+ end
213+
214+ def then_i_should_see_the_changes
215+ expect ( page ) . to have_css (
216+ ".app-highlight" ,
217+ text : "Right arm (upper position)"
218+ )
219+ expect ( page ) . to have_css ( ".app-highlight" , text : "Second" )
220+ expect ( page ) . to have_css ( ".app-highlight" , text : "1 January 2024" )
221+ expect ( page ) . to have_css ( ".app-highlight" , text : "10:00am" )
222+ end
223+
224+ def when_i_choose_to_keep_the_duplicate_record
209225 choose "Use duplicate record"
210226 click_on "Resolve duplicate"
211227 end
@@ -240,7 +256,7 @@ def when_i_record_vaccination_outcomes_to_the_spreadsheet_and_export_it_to_csv
240256 #
241257 # ideally we could drive Excel here (or similar) but the code below is better than nothing
242258
243- array = @workbook [ 0 ] . to_a [ 1 ..] . map ( &:cells ) . map { _1 . map ( &:value ) }
259+ array = @workbook [ 0 ] . to_a [ 1 ..] . map ( &:cells ) . map { it . map ( &:value ) }
244260 csv_table =
245261 CSV ::Table . new (
246262 array . map do |row |
@@ -398,10 +414,10 @@ def and_a_text_is_sent_to_the_parent_confirming_the_vaccination
398414 )
399415 end
400416
401- def then_i_see_there_are_previously_imported_records
417+ def then_i_see_there_are_no_previously_imported_records
402418 expect ( page ) . to have_content ( "Completed" )
403419 expect ( page ) . not_to have_content ( "Invalid" )
404- expect ( page ) . to have_content ( "2 previously imported records were omitted" )
420+ expect ( page ) . to have_content ( "0 previously imported records were omitted" )
405421 end
406422
407423 def then_i_see_a_duplicate_record_needs_review
0 commit comments