import { describe, it, expect, vi } from 'vitest'
import { render, screen, fireEvent } from '@testing-library/react'
import { I18nProvider } from '../i18n'
import { NotFoundPage } from './NotFoundPage'

describe('NotFoundPage', () => {
  it('renders a 404 with navigation back to Pay/Enroll', () => {
    const onNav = vi.fn()
    render(<I18nProvider initial="en"><NotFoundPage onNav={onNav} /></I18nProvider>)
    expect(screen.getByText('Page not found')).toBeInTheDocument()
    fireEvent.click(screen.getByRole('button', { name: 'Go to Pay' }))
    expect(onNav).toHaveBeenCalledWith('pay')
  })
})
