Align queue/branch and specialty CTA tests with patient-queue access rules.
Deploy Ladill Care / deploy (push) Successful in 42s

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 <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 19:51:55 +00:00
co-authored by Cursor
parent a5bbbe23b1
commit eaba400c7c
2 changed files with 16 additions and 8 deletions
+7 -7
View File
@@ -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
+9 -1
View File
@@ -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,