Files
websitedev/proto/src/components/Footer.test.tsx
T

72 lines
2.6 KiB
TypeScript
Executable File

import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom'
import Footer from './Footer'
describe('Footer', () => {
it('should render company information', () => {
render(<Footer />)
expect(screen.getByText('mozdIT Bt.')).toBeInTheDocument()
expect(screen.getByText('Megbízható web- és email szolgáltatás személyre szabott támogatással. Stabil tárhely, üzembiztos levelezés és DNS adminisztráció gyors reakcióval.')).toBeInTheDocument()
})
it('should render email and company details', () => {
render(<Footer />)
expect(screen.getByText('info@mozdit.hu')).toBeInTheDocument()
expect(screen.getAllByText('mozdIT Bt.').length).toBeGreaterThan(0)
expect(screen.getByText('Budapest, Magyarország')).toBeInTheDocument()
})
it('should render navigation links', () => {
render(<Footer />)
expect(screen.getByText('Kezdőlap')).toBeInTheDocument()
expect(screen.getByText('Rólunk')).toBeInTheDocument()
expect(screen.getAllByText('Szolgáltatások')).toHaveLength(2) // Both in navigation and services section
expect(screen.getByText('Kapcsolat')).toBeInTheDocument()
})
it('should render service sections', () => {
render(<Footer />)
expect(screen.getByText('Webtárhely (Hosting)')).toBeInTheDocument()
expect(screen.getByText('E-mail szolgáltatás')).toBeInTheDocument()
expect(screen.getByText('Domain és DNS')).toBeInTheDocument()
expect(screen.getByText('Műszaki támogatás')).toBeInTheDocument()
})
it('should render copyright notice with dynamic year', () => {
render(<Footer />)
const currentYear = new Date().getFullYear()
expect(screen.getByText(${currentYear} mozdIT Bt. Minden jog fenntartva.`)).toBeInTheDocument()
})
it('should render legal links', () => {
render(<Footer />)
expect(screen.getAllByText('Adatvédelmi tájékoztató')).toHaveLength(2) // Appears in both sections
expect(screen.getAllByText('Használati feltételek')).toHaveLength(2) // Appears in both sections
})
it('should render with proper grid layout', () => {
const { container } = render(<Footer />)
const gridContainer = container.querySelector('.grid.grid-cols-1.md\\:grid-cols-4')
expect(gridContainer).toBeInTheDocument()
// Check for responsive grid classes
expect(gridContainer).toHaveClass('grid-cols-1', 'md:grid-cols-4')
})
it('should render with proper semantic structure', () => {
const { container } = render(<Footer />)
// Should have a footer element
const footer = container.firstChild as HTMLElement
expect(footer?.tagName).toBe('FOOTER')
// footer element exists
})
})