diff --git a/app/admin/page.test.tsx b/app/admin/page.test.tsx new file mode 100644 index 0000000..c54c61f --- /dev/null +++ b/app/admin/page.test.tsx @@ -0,0 +1,72 @@ +import { fireEvent, render, screen, waitFor } from '@testing-library/react' +import { useSession } from 'next-auth/react' +import AdminPage from './page' + +const push = jest.fn() +const router = { push } +const confirmAction = jest.fn() +jest.mock('next-auth/react', () => ({ useSession: jest.fn() })) +jest.mock('next/navigation', () => ({ useRouter: () => router })) +jest.mock('@/components/ConfirmActionDialog', () => ({ useConfirmActionDialog: () => ({ confirmAction, confirmActionDialog: null }) })) +jest.mock('@/components/board/MaterialsHeader', () => () => null) +jest.mock('@/components/DepartmentPermissionsTab', () => () => null) +jest.mock('@/components/admin/MaterialManagement', () => () => null) +jest.mock('@/components/admin/CategoryManagement', () => () => null) +jest.mock('@/components/admin/PublicTrafficTab', () => () => null) +jest.mock('@/components/admin/DataStatisticsTab', () => function TestDataStatisticsTab() { return