Give each specialty module a distinct Heroicon-style icon.
Deploy Ladill Care / deploy (push) Successful in 1m2s
Deploy Ladill Care / deploy (push) Successful in 1m2s
Icon names live on the specialty catalog; SVG paths resolve through a shared map and render in sidebar, dashboard, settings, and the specialty shell. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -380,4 +380,43 @@ class CareSpecialtyModulesTest extends TestCase
|
||||
$this->assertTrue((bool) ($catalog['emergency']['default_on_paid_plans'] ?? false));
|
||||
$this->assertTrue((bool) ($catalog['blood_bank']['default_on_paid_plans'] ?? false));
|
||||
}
|
||||
|
||||
public function test_each_specialty_module_has_a_unique_icon(): void
|
||||
{
|
||||
$service = app(SpecialtyModuleService::class);
|
||||
$catalog = $service->catalog();
|
||||
$iconNames = [];
|
||||
$iconPaths = [];
|
||||
|
||||
foreach (array_keys($catalog) as $key) {
|
||||
$name = $service->iconName($key);
|
||||
$path = $service->iconSvgPath($key);
|
||||
$this->assertNotSame('', $name, "Module [{$key}] missing icon name");
|
||||
$this->assertNotSame('', $path, "Module [{$key}] missing icon SVG path");
|
||||
$this->assertArrayHasKey($name, config('care.specialty_icons'));
|
||||
$iconNames[$key] = $name;
|
||||
$iconPaths[$key] = $path;
|
||||
}
|
||||
|
||||
$this->assertCount(count($iconNames), array_unique(array_values($iconNames)));
|
||||
$this->assertCount(count($iconPaths), array_unique(array_values($iconPaths)));
|
||||
}
|
||||
|
||||
public function test_modules_settings_renders_distinct_specialty_icons(): void
|
||||
{
|
||||
$response = $this->actingAs($this->owner)
|
||||
->get(route('care.settings.modules'))
|
||||
->assertOk();
|
||||
|
||||
$response->assertSee(care_specialty_icon_path('dentistry'), false);
|
||||
$response->assertSee(care_specialty_icon_path('emergency'), false);
|
||||
$this->assertNotSame(
|
||||
care_specialty_icon_path('dentistry'),
|
||||
care_specialty_icon_path('emergency'),
|
||||
);
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
->get(route('care.dashboard'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user