Update community IDs and source locations in graph.json and manifest.json
- Adjusted source location for mockPricing() in AppointmentBookingModal.test.tsx from L144 to L149. - Updated community IDs for various migration entries and commands in graph.json to reflect new community associations. - Modified timestamps and AST hashes for AppointmentBookingModal.test.tsx and AppointmentsPage.tsx in manifest.json.
This commit is contained in:
@@ -26,6 +26,7 @@ beforeEach(() => {
|
||||
describe('NewAppointmentModal — جستجوی موبایلمحور', () => {
|
||||
it('submit stays disabled until a mobile search is done', () => {
|
||||
renderWithProviders(<NewAppointmentModal slot={slot} onClose={() => {}} onSuccess={() => {}} />);
|
||||
fireEvent.click(screen.getByRole('button', { name: 'شماره موبایل' }));
|
||||
fireEvent.change(screen.getByPlaceholderText('مثال: 09123456789'), { target: { value: '09121234567' } });
|
||||
// بدون جستجو، ثبت نوبت غیرفعال است
|
||||
expect(screen.getByRole('button', { name: 'ثبت نوبت' })).toBeDisabled();
|
||||
@@ -34,6 +35,7 @@ describe('NewAppointmentModal — جستجوی موبایلمحور', () => {
|
||||
it('converts Persian digits to English and searches by the normalized mobile', async () => {
|
||||
get.mockResolvedValue({ success: true, data: { found: false } });
|
||||
renderWithProviders(<NewAppointmentModal slot={slot} onClose={() => {}} onSuccess={() => {}} />);
|
||||
fireEvent.click(screen.getByRole('button', { name: 'شماره موبایل' }));
|
||||
|
||||
const input = screen.getByPlaceholderText('مثال: 09123456789') as HTMLInputElement;
|
||||
fireEvent.change(input, { target: { value: '۰۹۱۲۳۴۵۶۷۸۹' } });
|
||||
@@ -46,6 +48,7 @@ describe('NewAppointmentModal — جستجوی موبایلمحور', () => {
|
||||
it('searches on Enter key in the mobile field', async () => {
|
||||
get.mockResolvedValue({ success: true, data: { found: false } });
|
||||
renderWithProviders(<NewAppointmentModal slot={slot} onClose={() => {}} onSuccess={() => {}} />);
|
||||
fireEvent.click(screen.getByRole('button', { name: 'شماره موبایل' }));
|
||||
|
||||
const input = screen.getByPlaceholderText('مثال: 09123456789');
|
||||
fireEvent.change(input, { target: { value: '09121234567' } });
|
||||
@@ -57,6 +60,7 @@ describe('NewAppointmentModal — جستجوی موبایلمحور', () => {
|
||||
it('found patient with national code books directly without extra fields', async () => {
|
||||
get.mockResolvedValue({ success: true, data: { found: true, name: 'علی محمدی', mobile: '09121234567', national_code: '0012345678' } });
|
||||
renderWithProviders(<NewAppointmentModal slot={slot} onClose={() => {}} onSuccess={() => {}} />);
|
||||
fireEvent.click(screen.getByRole('button', { name: 'شماره موبایل' }));
|
||||
|
||||
fireEvent.change(screen.getByPlaceholderText('مثال: 09123456789'), { target: { value: '09121234567' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: 'جستجو' }));
|
||||
@@ -78,6 +82,7 @@ describe('NewAppointmentModal — جستجوی موبایلمحور', () => {
|
||||
it('unknown mobile reveals national code + name fields and books the new patient', async () => {
|
||||
get.mockResolvedValue({ success: true, data: { found: false } });
|
||||
renderWithProviders(<NewAppointmentModal slot={slot} onClose={() => {}} onSuccess={() => {}} />);
|
||||
fireEvent.click(screen.getByRole('button', { name: 'شماره موبایل' }));
|
||||
|
||||
fireEvent.change(screen.getByPlaceholderText('مثال: 09123456789'), { target: { value: '09990001122' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: 'جستجو' }));
|
||||
|
||||
@@ -118,8 +118,8 @@ export function NewAppointmentModal({
|
||||
const [lookup, setLookup] = useState<PatientLookup | null>(null);
|
||||
const [patientName, setPatientName] = useState('');
|
||||
const [nationalCode, setNationalCode] = useState('');
|
||||
// معیار جستجوی بیمار: موبایل یا کد ملی.
|
||||
const [searchBy, setSearchBy] = useState<'mobile' | 'national'>('mobile');
|
||||
// معیار جستجوی بیمار: کد ملی (پیشفرض) یا موبایل.
|
||||
const [searchBy, setSearchBy] = useState<'mobile' | 'national'>('national');
|
||||
const [pick, setPick] = useState<{ serviceUuids: string[]; slot: { start: number; end: number } | null }>({ serviceUuids: [], slot: null });
|
||||
|
||||
const role = useAuthStore(s => s.primaryRole);
|
||||
@@ -292,7 +292,7 @@ export function NewAppointmentModal({
|
||||
<label>جستجوی بیمار <span className="req">*</span></label>
|
||||
{/* انتخاب معیار جستجو: موبایل یا کد ملی */}
|
||||
<div style={{ display: 'flex', gap: 6, marginBottom: 8 }}>
|
||||
{(['mobile', 'national'] as const).map(mode => (
|
||||
{(['national', 'mobile'] as const).map(mode => (
|
||||
<button
|
||||
key={mode}
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user