import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';

vi.mock('next/link', () => ({
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  default: (props: any) => <a href={props.href}>{props.children}</a>,
}));

import HomePage from '../../src/app/page';

describe('HomePage', () => {
  it('renders MeshiTrack heading', () => {
    render(<HomePage />);
    expect(screen.getByText('MeshiTrack')).toBeInTheDocument();
  });

  it('renders Sign In link to /login', () => {
    render(<HomePage />);
    const link = screen.getByRole('link', { name: 'Sign In' });
    expect(link).toHaveAttribute('href', '/login');
  });
});
