import React from 'react'
import { renderWithProviders, screen } from '@/__tests__/utils/test-helpers'
import Footer from './footer'
jest.mock('lucide-react', () => ({
Mail: () => ,
Github: () => ,
Twitter: () => ,
}))
jest.mock('next/link', () => ({
__esModule: true,
default: ({ children, href }: any) => {children},
}))
describe('Footer Component', () => {
it('should render footer with branding', () => {
renderWithProviders()
expect(screen.getByText('Portfolio Host')).toBeInTheDocument()
})
it('should display tagline', () => {
renderWithProviders()
expect(screen.getByText(/host your portfolio with ease/i)).toBeInTheDocument()
})
it('should have product links', () => {
renderWithProviders()
expect(screen.getByText('Product')).toBeInTheDocument()
expect(screen.getByRole('link', { name: /get started/i })).toBeInTheDocument()
})
it('should have resource links', () => {
renderWithProviders()
expect(screen.getByText('Resources')).toBeInTheDocument()
expect(screen.getByText('Documentation')).toBeInTheDocument()
})
it('should have social media links', () => {
renderWithProviders()
expect(screen.getByText('Connect')).toBeInTheDocument()
const emailLink = screen.getByRole('link', { name: /email/i })
expect(emailLink).toHaveAttribute('href', 'mailto:hello@portfoliohost.com')
})
it('should display copyright year', () => {
renderWithProviders()
expect(screen.getByText(/© 2025 Portfolio Host/)).toBeInTheDocument()
})
it('should have legal links in footer', () => {
renderWithProviders()
expect(screen.getByText('Privacy')).toBeInTheDocument()
expect(screen.getByText('Terms')).toBeInTheDocument()
expect(screen.getByText('Cookies')).toBeInTheDocument()
})
it('should use correct year from prop', () => {
renderWithProviders()
expect(screen.getByText(/© 2024 Portfolio Host/)).toBeInTheDocument()
})
it('should have correct link hrefs', () => {
renderWithProviders()
const registerLink = screen.getByRole('link', { name: /get started/i })
expect(registerLink).toHaveAttribute('href', '/register')
})
})