@@ -39,6 +39,14 @@ def test_accessibility(self):
3939 self .when_i_click_on_add_breast_cancer_history ()
4040 self .then_the_accessibility_baseline_is_met ()
4141
42+ def test_validation_errors (self ):
43+ self .given_i_am_logged_in_as_a_clinical_user ()
44+ self .and_there_is_an_appointment ()
45+ self .and_i_am_on_the_record_medical_information_page ()
46+ self .when_i_click_on_add_breast_cancer_history ()
47+ self .and_i_click_save ()
48+ self .then_i_am_prompted_to_fill_in_required_fields ()
49+
4250 def and_there_is_an_appointment (self ):
4351 self .participant = ParticipantFactory (first_name = "Janet" , last_name = "Williams" )
4452 self .screening_episode = ScreeningEpisodeFactory (participant = self .participant )
@@ -136,3 +144,18 @@ def and_i_enter_the_details_of_the_private_clinic(self):
136144 "Where did surgery and treatment take place?"
137145 )
138146 fieldset .get_by_label ("Provide details" ).filter (visible = True ).fill ("Abc clinic" )
147+
148+ def then_i_am_prompted_to_fill_in_required_fields (self ):
149+ self .expect_validation_error (
150+ error_text = "Select which breasts cancer was diagnosed in" ,
151+ fieldset_legend = "In which breasts was cancer diagnosed?" ,
152+ field_label = "Right breast" ,
153+ field_name = "diagnosis_location" ,
154+ )
155+
156+ self .expect_validation_error (
157+ error_text = "Select which procedure they have had in the right breast" ,
158+ fieldset_legend = "What procedure have they had in their Right breast (or axilla)" ,
159+ field_label = "Lumpectomy" ,
160+ field_name = "right_breast_procedure" ,
161+ )
0 commit comments