feat(services): add services menu item to sidebar and update related components

This commit is contained in:
hamed
2026-07-15 16:35:02 +03:30
parent 704e69f05f
commit 5c15a4dd7f
5 changed files with 37 additions and 11 deletions
@@ -41,3 +41,23 @@ describe('Sidebar — expandable نوبت‌ها menu', () => {
expect(screen.getByText('نوبت های تایید شده')).toBeInTheDocument();
});
});
describe('Sidebar — خدمات در منوی اصلی (نه تنظیمات)', () => {
it('shows خدمات in the clinic main menu linking to /admin/clinic-services', () => {
useAuthStore.setState({
primaryRole: 'clinic', dbUuid: 'c1', userName: 'کلینیک',
availableContexts: [], context: null,
} as any);
renderWithProviders(<Sidebar />, { route: '/admin/dashboard' });
expect(screen.getByText('سرویس ها').closest('a')).toHaveAttribute('href', '/admin/clinic-services');
});
it('shows خدمات in the doctor main menu linking to /admin/clinic-services', () => {
useAuthStore.setState({
primaryRole: 'doctor', dbUuid: null, userName: 'پزشک',
availableContexts: [], context: null,
} as any);
renderWithProviders(<Sidebar />, { route: '/admin/dashboard' });
expect(screen.getByText('سرویس ها').closest('a')).toHaveAttribute('href', '/admin/clinic-services');
});
});