Hide Specialty sidebar group for desk specialists.
Deploy Ladill Care / deploy (push) Successful in 2m34s

Single-desk specialists already reach their workspace via dashboard cards; the Specialty → Dentistry nav group was redundant. GPs and multi-module roles keep the section.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 22:29:30 +00:00
co-authored by Cursor
parent c8a7115e49
commit 244bb8fba6
3 changed files with 71 additions and 10 deletions
+32
View File
@@ -189,15 +189,45 @@ class CareSpecialtyAccessTest extends TestCase
$this->assertNotContains('blood_bank', $enabledKeys);
$this->assertNotContains('cardiology', $enabledKeys);
// Single-desk specialists: no Specialty sidebar group (dashboard cards remain).
$this->assertFalse($this->modules->shouldShowSpecialtyNav($this->organization, $member));
$this->actingAs($doctor)
->get(route('care.dashboard'))
->assertOk()
->assertSee('Dentistry')
->assertSee('Specialty modules')
->assertDontSee('>Specialty</p>', false)
->assertDontSee('Emergency')
->assertDontSee('Cardiology')
->assertDontSee('Blood Bank');
}
public function test_gp_keeps_specialty_sidebar_nav(): void
{
[$doctor, $member] = $this->makeStaff('doctor', 'gp-nav');
Practitioner::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'member_id' => $member->id,
'user_ref' => $doctor->public_id,
'name' => 'Dr GP Nav',
'specialty' => 'General Practice',
'is_active' => true,
]);
$this->assertFalse($this->modules->isDeskSpecialist($this->organization, $member));
$this->assertTrue($this->modules->shouldShowSpecialtyNav($this->organization, $member));
$this->actingAs($doctor)
->get(route('care.dashboard'))
->assertOk()
->assertSee('>Specialty</p>', false)
->assertSee('Emergency')
->assertSee('Dentistry');
}
public function test_dentistry_specialty_does_not_match_ent_keyword(): void
{
[$doctor, $member] = $this->makeStaff('doctor', 'dentist-ent-trap');
@@ -340,10 +370,12 @@ class CareSpecialtyAccessTest extends TestCase
$this->assertContains('infusion', $enabledForMember);
$this->assertNotContains('cardiology', $enabledForMember);
$this->assertNotContains('dentistry', $enabledForMember);
$this->assertTrue($this->modules->shouldShowSpecialtyNav($this->organization, $pharmacistMember));
$this->actingAs($pharmacistUser)
->get(route('care.dashboard'))
->assertOk()
->assertSee('>Specialty</p>', false)
->assertSee('Emergency')
->assertDontSee('Cardiology');
}