Some checks failed
Dev Deployment (Zero Downtime) / deploy-dev (push) Failing after 9m19s
Fixed missing types, import errors, and updated test suites to match the new editorial design. Verified Docker container build.
35 lines
960 B
TypeScript
35 lines
960 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import Header from '@/app/components/Header';
|
|
|
|
// Mock next-intl
|
|
jest.mock('next-intl', () => ({
|
|
useLocale: () => 'en',
|
|
useTranslations: () => (key: string) => {
|
|
const messages: Record<string, string> = {
|
|
home: 'Home',
|
|
about: 'About',
|
|
projects: 'Projects',
|
|
contact: 'Contact'
|
|
};
|
|
return messages[key] || key;
|
|
},
|
|
}));
|
|
|
|
// Mock next/navigation
|
|
jest.mock('next/navigation', () => ({
|
|
usePathname: () => '/en',
|
|
}));
|
|
|
|
describe('Header', () => {
|
|
it('renders the header with the dk logo', () => {
|
|
render(<Header />);
|
|
expect(screen.getByText('dk')).toBeInTheDocument();
|
|
|
|
// Check for navigation links
|
|
expect(screen.getByText('Home')).toBeInTheDocument();
|
|
expect(screen.getByText('About')).toBeInTheDocument();
|
|
expect(screen.getByText('Projects')).toBeInTheDocument();
|
|
expect(screen.getByText('Contact')).toBeInTheDocument();
|
|
});
|
|
});
|