feat: move "منابع" to main sidebar and update related components

This commit is contained in:
hamed
2026-08-03 09:52:41 +03:30
parent 17ce271b2c
commit 82abd1bb52
9 changed files with 199 additions and 172 deletions
@@ -141,6 +141,22 @@ describe("Sidebar — گِیت منوی منشی بر اساس مجوز", () =>
expect(screen.queryByText("تنظیمات نوبت‌دهی")).not.toBeInTheDocument();
expect(screen.queryByText("پزشکان کلینیک")).not.toBeInTheDocument();
});
/**
* «منابع» از منوی تنظیمات به سایدبار اصلی منتقل شد. گِیتش عوض نشده — همان
* `appointment_settings.view` که در منوی تنظیمات داشت.
*/
it("«منابع» در سایدبار اصلی می‌آید و به مجوز appointment_settings گِیت است", () => {
setSecretary({ appointment_settings: { view: true } });
renderWithProviders(<Sidebar />, { route: "/admin/dashboard" });
expect(screen.getByText("منابع").closest("a")).toHaveAttribute("href", "/admin/resources");
});
it("منشیِ بدون مجوز، «منابع» را نمی‌بیند", () => {
setSecretary({ appointments: { view: true } });
renderWithProviders(<Sidebar />, { route: "/admin/dashboard" });
expect(screen.queryByText("منابع")).not.toBeInTheDocument();
});
});
describe("Sidebar — گِیت منوی پزشکِ عضوِ کلینیک بر اساس مجوز", () => {