14
14
15
15
when_i_record_vaccination_outcomes_to_the_spreadsheet_and_export_it_to_csv
16
16
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
18
18
when_i_navigate_to_the_session_page
19
19
then_i_see_the_uploaded_vaccination_outcomes_reflected_in_the_session
20
20
32
32
33
33
when_i_record_vaccination_outcomes_to_the_spreadsheet_and_export_it_to_csv
34
34
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
36
36
when_i_navigate_to_the_clinic_page
37
37
then_i_see_the_uploaded_vaccination_outcomes_reflected_in_the_session
38
38
and_the_clinic_location_is_displayed
51
51
and_i_upload_the_modified_csv_file
52
52
then_i_see_a_duplicate_record_needs_review
53
53
54
+ when_i_review_the_duplicate_record
55
+ then_i_should_see_the_changes
56
+
54
57
when_i_choose_to_keep_the_duplicate_record
55
58
then_i_should_see_a_success_message
56
59
and_the_vaccination_record_is_synced_to_nhs
@@ -189,7 +192,7 @@ def and_alter_an_existing_vaccination_record
189
192
@sheet = @workbook [ "Vaccinations" ]
190
193
@headers = @sheet [ 0 ] . cells . map ( &:value )
191
194
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 ) }
193
196
csv_table =
194
197
CSV ::Table . new (
195
198
array . map do |row |
@@ -204,8 +207,21 @@ def and_alter_an_existing_vaccination_record
204
207
File . write ( "tmp/modified.csv" , csv_table . to_csv )
205
208
end
206
209
207
- def when_i_choose_to_keep_the_duplicate_record
210
+ def when_i_review_the_duplicate_record
208
211
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
209
225
choose "Use duplicate record"
210
226
click_on "Resolve duplicate"
211
227
end
@@ -240,7 +256,7 @@ def when_i_record_vaccination_outcomes_to_the_spreadsheet_and_export_it_to_csv
240
256
#
241
257
# ideally we could drive Excel here (or similar) but the code below is better than nothing
242
258
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 ) }
244
260
csv_table =
245
261
CSV ::Table . new (
246
262
array . map do |row |
@@ -398,10 +414,10 @@ def and_a_text_is_sent_to_the_parent_confirming_the_vaccination
398
414
)
399
415
end
400
416
401
- def then_i_see_there_are_previously_imported_records
417
+ def then_i_see_there_are_no_previously_imported_records
402
418
expect ( page ) . to have_content ( "Completed" )
403
419
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" )
405
421
end
406
422
407
423
def then_i_see_a_duplicate_record_needs_review
0 commit comments