From eaba400c7ca8cabe15b964b3df7fecec3672fe6b Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 18 Jul 2026 19:51:55 +0000 Subject: [PATCH] Align queue/branch and specialty CTA tests with patient-queue access rules. hospital_admin no longer opens /queue, and nurses get Specialty home instead of Back to queue after the patient-flow board gate. Co-authored-by: Cursor --- tests/Feature/CareBranchContextTest.php | 14 +++++++------- tests/Feature/CareSpecialtyAccessTest.php | 10 +++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/Feature/CareBranchContextTest.php b/tests/Feature/CareBranchContextTest.php index 6a75925..9f4c6ba 100644 --- a/tests/Feature/CareBranchContextTest.php +++ b/tests/Feature/CareBranchContextTest.php @@ -93,13 +93,16 @@ class CareBranchContextTest extends TestCase $this->makeActivePrescription($this->west, $this->westPatient, 'West Med'); } - public function test_admin_branch_filter_persists_from_patient_queue_to_pharmacy(): void + public function test_admin_branch_filter_persists_from_pharmacy_to_lab(): void { + // hospital_admin cannot open the patient-flow board; pharmacy/lab still share BranchContext. $this->actingAs($this->user) - ->get(route('care.queue.index', ['branch_id' => $this->west->id])) + ->get(route('care.prescriptions.queue', ['branch_id' => $this->west->id])) ->assertOk() ->assertSee('West Hills Care') + ->assertSee('West Med') ->assertSee('Kofi West') + ->assertDontSee('East Med') ->assertDontSee('Ama East'); $this->assertSame( @@ -108,13 +111,10 @@ class CareBranchContextTest extends TestCase ); $this->actingAs($this->user) - ->get(route('care.prescriptions.queue')) + ->get(route('care.lab.queue.index')) ->assertOk() ->assertSee('West Hills Care') - ->assertSee('West Med') - ->assertSee('Kofi West') - ->assertDontSee('East Med') - ->assertDontSee('Ama East'); + ->assertSee('selected>West Hills Care', false); } public function test_pharmacy_queue_branch_filter_scopes_list_for_admin(): void diff --git a/tests/Feature/CareSpecialtyAccessTest.php b/tests/Feature/CareSpecialtyAccessTest.php index 0521b52..ca16497 100644 --- a/tests/Feature/CareSpecialtyAccessTest.php +++ b/tests/Feature/CareSpecialtyAccessTest.php @@ -480,10 +480,18 @@ class CareSpecialtyAccessTest extends TestCase ->assertSee('consultation access') ->assertDontSee('Seat at chair') ->assertDontSee('Start triage') - ->assertSee('Back to queue') ->assertSee('Patient chart') ->getContent(); + // Nurses keep specialty workspaces but lose the patient-flow board link. + if ($permissions->canAccessPatientQueue($member)) { + $this->assertStringContainsString('Back to queue', $html); + $this->assertStringNotContainsString('Specialty home', $html); + } else { + $this->assertStringNotContainsString('Back to queue', $html); + $this->assertStringContainsString('Specialty home', $html); + } + $this->assertStringNotContainsString( route('care.specialty.consultation.start', ['module' => $module, 'visit' => $visit], absolute: false), $html,