/**
 * (share/layout/auth — shell with header/main/footer and i18n).
 */
import React from 'react'
import { render, screen } from '@testing-library/react'

import AuthViewLayout from '../index'

jest.mock('@/share/layout/end-user/header', () => ({
  __esModule: true,
  default: () => <div data-testid="eu-header" />,
}))

jest.mock('next-intl', () => ({
  useTranslations: () => (key: string) =>
    key === 'footer.copyright' ? '© Test copyright' : key,
}))

describe('[share/layout/auth]', () => {
  describe('AuthViewLayout', () => {
    it('renders header, main children, and footer with translated copyright', () => {
      render(
        <AuthViewLayout>
          <div>auth-form-slot</div>
        </AuthViewLayout>,
      )

      expect(screen.getByTestId('eu-header')).toBeInTheDocument()
      expect(screen.getByText('auth-form-slot')).toBeInTheDocument()
      expect(screen.getByText('© Test copyright')).toBeInTheDocument()
    })
  })
})
