import { render, screen } from '@testing-library/react';
import NotFound from '@/app/not-found';

jest.mock('next/navigation', () => ({
  useRouter: () => ({
    back: jest.fn(),
    push: jest.fn(),
  }),
}));

jest.mock('next-intl', () => ({
  useLocale: () => 'en',
  useTranslations: () => (key: string) => {
    const map: Record<string, string> = {
      'title': 'Page not Found',
      'description': 'The content you are looking for has been moved, deleted, or never existed.',
      'returnHome': 'Return Home',
      'goBack': 'Go Back',
      'exploreWork': 'Explore Work',
      'exploreWorkDesc': 'Maybe what you need is in my project archive?',
      'viewProjects': 'View Projects',
      'errorReport': 'Error Report',
    };
    return map[key] ?? key;
  },
}));

describe('NotFound', () => {
  it('renders the 404 page', () => {
    render(<NotFound />);
    expect(screen.getByText('404')).toBeInTheDocument();
  });
});