feat: refactor resource management by removing modal components and integrating functionality into tabs; add ResourceBlocksPanel for temporary deactivation of resources

This commit is contained in:
hamed
2026-08-03 10:12:01 +03:30
parent b2b36e3eec
commit 00c275d618
10 changed files with 391 additions and 362 deletions
+18
View File
@@ -107,4 +107,22 @@ describe('ResourcesPage', () => {
// شعبه و نوع هنوز انتخاب نشده‌اند → ذخیره غیرفعال است.
expect(screen.getByText('ذخیره').closest('button')).toBeDisabled();
});
/**
* جدول فقط فهرست است. هر اقدامِ سطح-منبع تبی در خودِ منبع دارد، پس ردیف یک لینک
* دارد نه شش دکمه — که هم جدول را از لبه بیرون می‌زد، هم یک کار را دو جا می‌گذاشت.
*/
it('هر ردیف فقط یک اقدام دارد: مدیریتِ همان منبع', async () => {
mockApi();
renderWithProviders(<ResourcesPage />, { route: '/admin/resources' });
await waitFor(() => expect(screen.getByText('لیزر ۱')).toBeInTheDocument());
expect(screen.getAllByRole('link', { name: 'مدیریت' })[0])
.toHaveAttribute('href', '/admin/resources/r1');
for (const gone of ['ویرایش', 'مهارت‌ها', 'سرویس‌ها', 'مسدودسازی', 'حذف', 'تنظیمات']) {
expect(screen.queryByRole('button', { name: gone })).not.toBeInTheDocument();
}
});
});