- 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.
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
/**
|
|
* Tests for Admin Settings Page
|
|
* Verifies rendering of system settings placeholder
|
|
*/
|
|
|
|
import { render, screen } from '@testing-library/react';
|
|
import AdminSettingsPage from '@/app/[locale]/admin/settings/page';
|
|
|
|
describe('AdminSettingsPage', () => {
|
|
it('renders page title', () => {
|
|
render(<AdminSettingsPage />);
|
|
|
|
expect(screen.getByText('System Settings')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders page description', () => {
|
|
render(<AdminSettingsPage />);
|
|
|
|
expect(screen.getByText('Configure system-wide settings and preferences')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders back button link', () => {
|
|
render(<AdminSettingsPage />);
|
|
|
|
const backLink = screen.getByRole('link', { name: '' });
|
|
expect(backLink).toHaveAttribute('href', '/admin');
|
|
});
|
|
|
|
it('renders coming soon message', () => {
|
|
render(<AdminSettingsPage />);
|
|
|
|
expect(screen.getByText('System Settings Coming Soon')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders feature list', () => {
|
|
render(<AdminSettingsPage />);
|
|
|
|
expect(screen.getByText(/General system configuration/)).toBeInTheDocument();
|
|
expect(screen.getByText(/Email and notification settings/)).toBeInTheDocument();
|
|
expect(screen.getByText(/Security and authentication options/)).toBeInTheDocument();
|
|
expect(screen.getByText(/API and integration settings/)).toBeInTheDocument();
|
|
expect(screen.getByText(/Maintenance and backup tools/)).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders with proper container structure', () => {
|
|
const { container } = render(<AdminSettingsPage />);
|
|
|
|
const containerDiv = container.querySelector('.container');
|
|
expect(containerDiv).toBeInTheDocument();
|
|
expect(containerDiv).toHaveClass('mx-auto', 'px-6', 'py-8');
|
|
});
|
|
});
|