refactor: move secretary and staff management from main nav to settings menu
Remove پرسنل (/admin/staff) and منشی ها (/admin/my-secretaries) from the clinic and doctor main sidebars; surface them under the settings menu instead (PurchaseSubscriptionSidebar + SETTINGS_MENU). Wrap StaffPage in SettingsLayout so it renders inside the settings shell like MySecretariesPage already does. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { renderWithProviders } from '../../test/utils';
|
||||
import PurchaseSubscriptionSidebar from './PurchaseSubscriptionSidebar';
|
||||
|
||||
describe('PurchaseSubscriptionSidebar — settings menu', () => {
|
||||
it('lists secretary and staff management (moved out of the main nav)', () => {
|
||||
renderWithProviders(<PurchaseSubscriptionSidebar active="staff" />, { route: '/admin/staff' });
|
||||
|
||||
const secretary = screen.getByRole('link', { name: 'مدیریت منشی' });
|
||||
const staff = screen.getByRole('link', { name: 'پرسنل' });
|
||||
|
||||
expect(secretary).toHaveAttribute('href', '/admin/my-secretaries');
|
||||
expect(staff).toHaveAttribute('href', '/admin/staff');
|
||||
});
|
||||
|
||||
it('highlights the active item (aria-current) for staff', () => {
|
||||
renderWithProviders(<PurchaseSubscriptionSidebar active="staff" />, { route: '/admin/staff' });
|
||||
expect(screen.getByRole('link', { name: 'پرسنل' })).toHaveAttribute('aria-current', 'page');
|
||||
expect(screen.getByRole('link', { name: 'مدیریت منشی' })).not.toHaveAttribute('aria-current');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user