@@ -66,10 +66,11 @@ def test_accessibility(self):
6666 def test_status_attribution_display (self ):
6767 self .given_i_am_logged_in_as_a_clinical_user ()
6868 self .and_a_clinic_exists_that_is_run_by_my_provider ()
69+ self .and_i_have_an_appointment_in_progress ()
6970 self .and_there_are_appointments_in_various_statuses_with_attributed_users ()
7071 self .and_i_am_on_the_clinic_show_page ()
7172 self .when_i_click_on_all ()
72- self .then_i_can_see_status_attribution_for_relevant_appointments ()
73+ self .then_i_can_see_status_attribution_for_these_appointments ()
7374
7475 def and_a_clinic_exists_that_is_run_by_my_provider (self ):
7576 user_assignment = self .current_user .assignments .first ()
@@ -266,7 +267,6 @@ def then_i_can_see_the_special_appointment_banner(self):
266267
267268 def and_there_are_appointments_in_various_statuses_with_attributed_users (self ):
268269 # Create users for attribution
269- user_in_progress = UserFactory (first_name = "Alice" , last_name = "User" )
270270 user_screened = UserFactory (first_name = "Bob" , last_name = "User" )
271271 user_cancelled = UserFactory (first_name = "Charlie" , last_name = "User" )
272272
@@ -278,17 +278,6 @@ def and_there_are_appointments_in_various_statuses_with_attributed_users(self):
278278 last_name = "Confirmed" ,
279279 )
280280
281- # STARTED status
282- self .in_progress_appointment = AppointmentFactory (
283- clinic_slot__clinic = self .clinic ,
284- first_name = "Participant" ,
285- last_name = "InProgress" ,
286- )
287- self .in_progress_appointment .statuses .create (
288- name = AppointmentStatus .STARTED ,
289- created_by = user_in_progress ,
290- )
291-
292281 # SCREENED status
293282 self .screened_appointment = AppointmentFactory (
294283 clinic_slot__clinic = self .clinic ,
@@ -311,7 +300,7 @@ def and_there_are_appointments_in_various_statuses_with_attributed_users(self):
311300 created_by = user_cancelled ,
312301 )
313302
314- def then_i_can_see_status_attribution_for_relevant_appointments (self ):
303+ def then_i_can_see_status_attribution_for_these_appointments (self ):
315304 confirmed_row = self .page .locator ("tr" ).filter (has_text = "Participant Confirmed" )
316305
317306 expect (confirmed_row ).not_to_contain_text ("with" )
@@ -320,10 +309,26 @@ def then_i_can_see_status_attribution_for_relevant_appointments(self):
320309 in_progress_row = self .page .locator ("tr" ).filter (
321310 has_text = "Participant InProgress"
322311 )
323- expect (in_progress_row ).to_contain_text ("with A. User" )
312+
313+ expect (in_progress_row ).to_contain_text (
314+ f"with { self .current_user .get_short_name ()} (you)"
315+ )
324316
325317 screened_row = self .page .locator ("tr" ).filter (has_text = "Participant Screened" )
326318 expect (screened_row ).to_contain_text ("by B. User" )
319+ expect (screened_row ).not_to_contain_text ("(you)" )
327320
328321 cancelled_row = self .page .locator ("tr" ).filter (has_text = "Participant Cancelled" )
329322 expect (cancelled_row ).to_contain_text ("by C. User" )
323+ expect (cancelled_row ).not_to_contain_text ("(you)" )
324+
325+ def and_i_have_an_appointment_in_progress (self ):
326+ self .in_progress_appointment = AppointmentFactory (
327+ clinic_slot__clinic = self .clinic ,
328+ first_name = "Participant" ,
329+ last_name = "InProgress" ,
330+ )
331+ self .in_progress_appointment .statuses .create (
332+ name = AppointmentStatus .STARTED ,
333+ created_by = self .current_user ,
334+ )
0 commit comments