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 .appointment import AppointmentStatus
46from manage_breast_screening .participants .models .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 ):
@@ -81,6 +88,13 @@ def then_i_see_the_add_benign_lump_history_form(self):
8188 expect (self .page .get_by_text ("Add details of benign lumps" )).to_be_visible ()
8289 self .assert_page_title_contains ("Add details of benign lumps" )
8390
91+ def and_i_see_the_appointment_status_bar (self ):
92+ status_bar = self .page .locator ("div.app-status-bar" )
93+ expect (status_bar ).to_contain_text (
94+ format_nhs_number (self .participant .nhs_number )
95+ )
96+ expect (status_bar ).to_contain_text (self .participant .full_name )
97+
8498 def when_i_try_to_save_without_entering_benign_lump_details (self ):
8599 self .page .get_by_role ("button" , name = "Save" ).click ()
86100
0 commit comments