feat: unify doctor title handling and enhance specialty selection
- Implemented a helper function `displayDoctorName` to prepend "دکتر" to doctor names for consistent display across the application. - Updated various components (InviteDoctorModal, DashboardPage, DoctorDetailPage, DoctorsPage, etc.) to utilize the new helper for rendering doctor names. - Modified the DoctorFormPage to automatically add the "دکتر" title in the UI without requiring user input. - Fixed the EditSpecialtyPicker component to allow multiple specialty selections, resolving a UI bug where only one specialty could be selected at a time. - Ensured that the backend strips the "دکتر" title from the name during pre-registration and doctor creation processes. - Added tests for the new functionality, including checks for title handling and specialty selection logic. - Updated API documentation to reflect changes in name handling and display logic.
This commit is contained in:
@@ -38,4 +38,16 @@ class PersianTextTest extends TestCase
|
||||
{
|
||||
$this->assertFalse(PersianText::sameName('علی اکبری', 'ولی اکبری'));
|
||||
}
|
||||
|
||||
public function testWithDoctorTitlePrependsExactlyOnce(): void
|
||||
{
|
||||
$this->assertSame('دکتر فرخنده حسینی', PersianText::withDoctorTitle('فرخنده حسینی'));
|
||||
// نامِ از پیش عنواندار «دکتر دکتر …» نمیشود
|
||||
$this->assertSame('دکتر فرخنده حسینی', PersianText::withDoctorTitle('دکتر فرخنده حسینی'));
|
||||
$this->assertSame('دکتر فرخنده حسینی', PersianText::withDoctorTitle('دکتر دکتر فرخنده حسینی'));
|
||||
// خالی/نال → رشتهٔ خالی (نه «دکتر» تنها)
|
||||
$this->assertSame('', PersianText::withDoctorTitle(''));
|
||||
$this->assertSame('', PersianText::withDoctorTitle(null));
|
||||
$this->assertSame('', PersianText::withDoctorTitle(' '));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user