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:
@@ -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']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user