feat(settings): render doctor/clinic settings pages inside the settings shell
Wrap the existing settings-area pages — doctor profile (مدیریت پزشک), insurance pricing (بیمه), payment report (پرداخت), SMS wallet (پیامکها), secretaries (منشی) and clinic info (مطب) — in SettingsLayout so they appear under the settings sub-navigation like the Figma design, with the matching menu item highlighted. Wire the doctor/clinic menu entries to their routes. The نوبتدهی / برچسبها / حساب کاربری entries stay as disabled placeholders until they have their own pages/designs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { renderWithProviders } from '../test/utils';
|
||||
|
||||
vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: vi.fn() } }));
|
||||
vi.mock('../lib/api', () => ({
|
||||
api: { get: vi.fn(), post: vi.fn(), patch: vi.fn(), put: vi.fn(), delete: vi.fn() },
|
||||
ApiError: class extends Error {},
|
||||
}));
|
||||
|
||||
import { api } from '../lib/api';
|
||||
import MyFinancialPage from './MyFinancialPage';
|
||||
|
||||
const get = api.get as ReturnType<typeof vi.fn>;
|
||||
|
||||
beforeEach(() => {
|
||||
get.mockReset();
|
||||
get.mockResolvedValue({ success: true, data: {
|
||||
total_paid: 0, total_pending: 0, monthly_chart: [],
|
||||
} });
|
||||
});
|
||||
|
||||
describe('MyFinancialPage inside the settings shell', () => {
|
||||
it('renders the settings sub-nav around the page content', async () => {
|
||||
renderWithProviders(<MyFinancialPage />, { route: '/admin/my-financial' });
|
||||
// settings shell menu
|
||||
expect(await screen.findByText('خرید اشتراک')).toBeInTheDocument();
|
||||
expect(screen.getByText('خدمات')).toBeInTheDocument();
|
||||
// page's own content
|
||||
expect(screen.getByText('گزارش مالی')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user