- Replaced static paths with dynamic locale subpaths (`/[locale]/*`) in imports, URLs, and assertions across tests. - Updated `next-intl` mocks for improved compatibility with `locale`-aware components. - Standardized `page.goto` and navigation tests with `/en` as the base locale for consistency.
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
/**
|
|
* Tests for Admin Organizations Page
|
|
* Basic structural tests - full component testing in E2E tests
|
|
*/
|
|
|
|
import { render, screen } from '@testing-library/react';
|
|
import AdminOrganizationsPage from '@/app/[locale]/admin/organizations/page';
|
|
|
|
// Mock the entire OrganizationManagementContent component
|
|
jest.mock('@/components/admin/organizations/OrganizationManagementContent', () => ({
|
|
OrganizationManagementContent: () => (
|
|
<div data-testid="organization-management">Organization Management</div>
|
|
),
|
|
}));
|
|
|
|
describe('AdminOrganizationsPage', () => {
|
|
it('renders with proper container structure', () => {
|
|
const { container } = render(<AdminOrganizationsPage />);
|
|
|
|
const containerDiv = container.querySelector('.container');
|
|
expect(containerDiv).toBeInTheDocument();
|
|
expect(containerDiv).toHaveClass('mx-auto', 'px-6', 'py-8');
|
|
});
|
|
|
|
it('renders organization management content', () => {
|
|
render(<AdminOrganizationsPage />);
|
|
|
|
expect(screen.getByTestId('organization-management')).toBeInTheDocument();
|
|
});
|
|
});
|