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 = { 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(
); 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(); }); });