11from django .urls import reverse
22from playwright .sync_api import expect
33
4+ from manage_breast_screening .core .utils .string_formatting import format_nhs_number
5+ from manage_breast_screening .participants .models import AppointmentStatus
46from manage_breast_screening .participants .models .medical_history .benign_lump_history_item import (
57 BenignLumpHistoryItem ,
68)
@@ -21,6 +23,7 @@ def test_adding_a_benign_lump_history_item(self):
2123 self .and_i_am_on_the_record_medical_information_page ()
2224 self .when_i_click_on_benign_lumps ()
2325 self .then_i_see_the_add_benign_lump_history_form ()
26+ self .and_i_see_the_appointment_status_bar ()
2427 self .when_i_try_to_save_without_entering_benign_lump_details ()
2528 self .then_i_see_validation_errors_for_missing_benign_lump_details ()
2629
@@ -63,6 +66,10 @@ def and_there_is_an_appointment(self):
6366 self .appointment = AppointmentFactory (
6467 screening_episode = self .screening_episode ,
6568 clinic_slot__clinic__setting__provider = self .current_provider ,
69+ current_status_params = {
70+ "state" : AppointmentStatus .IN_PROGRESS ,
71+ "created_by" : self .current_user ,
72+ },
6673 )
6774
6875 def and_i_am_on_the_record_medical_information_page (self ):
@@ -74,6 +81,13 @@ def and_i_am_on_the_record_medical_information_page(self):
7481 )
7582 )
7683
84+ def and_i_see_the_appointment_status_bar (self ):
85+ status_bar = self .page .locator ("div.app-status-bar" )
86+ expect (status_bar ).to_contain_text (
87+ format_nhs_number (self .participant .nhs_number )
88+ )
89+ expect (status_bar ).to_contain_text (self .participant .full_name )
90+
7791 def when_i_click_on_benign_lumps (self ):
7892 self .page .get_by_role ("button" ).filter (has_text = "Benign lumps" ).click ()
7993
0 commit comments