Implement HasLabel interface in multiple enum classes, refactor label methods to improve localization consistency, and update default phone configuration in HR settings. Enhance employee form with phone number formatting and localization tests for enum options.

This commit is contained in:
Mekan1206
2026-08-02 21:19:46 +05:00
parent eed46157cd
commit e16402b23f
13 changed files with 102 additions and 26 deletions

View File

@@ -2,12 +2,14 @@
declare(strict_types=1);
use App\Enums\EmploymentStatus;
use App\Enums\Gender;
use App\Enums\NavigationGroup;
use App\Filament\Resources\ActivityLogs\ActivityLogResource;
use App\Filament\Resources\Departments\DepartmentResource;
use App\Models\User;
use BezhanSalleh\LanguageSwitch\Events\LocaleChanged;
use Filament\Forms\Components\Select;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Event;
@@ -35,6 +37,21 @@ it('returns translated navigation group labels', function (): void {
expect(NavigationGroup::LeaveManagement->getLabel())->toBe('Dynç alyş dolandyryşy');
});
it('returns translated enum options for filament selects', function (): void {
App::setLocale('tk');
$options = Select::make('employment_status')
->options(EmploymentStatus::class)
->getOptions();
expect($options)->toBe([
'active' => 'Işleýär',
'inactive' => 'Wagtlaýyn işlemeýär',
'terminated' => 'Işden boşadyldy',
'on_leave' => 'Rugsatda',
]);
});
it('returns translated filament navigation group labels at request time', function (): void {
$admin = createAdminUser(['locale' => 'tk']);