/**
 * (metadata contract, provider wrapping).
 */
import React from 'react'
import { render, screen } from '@testing-library/react'
jest.mock('@/providers/recaptcha-provider', () => ({
  AuthRecaptchaProvider: ({ children }: { children: React.ReactNode }) => (
    <div data-testid="auth-recaptcha-provider">{children}</div>
  ),
}))

import SignupLayout, { metadata } from '../layout'

describe('[locale]/(auth)/signup/layout.tsx', () => {
  describe('metadata', () => {
    it('exports signup title string and empty description', () => {
      expect(metadata).toEqual({ title: 'Signup', description: '' })
    })
  })

  describe('provider shell', () => {
    it('happy path: wraps children in AuthRecaptchaProvider', () => {
      render(
        <SignupLayout>
          <div>signup-child</div>
        </SignupLayout>
      )

      expect(screen.getByTestId('auth-recaptcha-provider')).toBeInTheDocument()
      expect(screen.getByText('signup-child')).toBeInTheDocument()
    })
  })
})
