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

const renderLab = (locale: 'en' | 'ar' = 'en') =>
  render(<I18nProvider initial={locale}><BiometricsLabPage onNav={vi.fn()} /></I18nProvider>)

describe('BiometricsLabPage', () => {
  it('shows the fingerprint-image demo with the sensor disclaimer', () => {
    renderLab()
    expect(screen.getByTestId('fingerprint-demo')).toBeInTheDocument()
    expect(
      screen.getByText(/A website cannot retrieve the fingerprint stored in your phone or computer sensor/i),
    ).toBeInTheDocument()
  })

  it('provides the disclaimer in Arabic too', () => {
    renderLab('ar')
    expect(screen.getByText(/لا يمكن لأي موقع إلكتروني قراءة البصمة/)).toBeInTheDocument()
  })
})
