feat: add allowed Linear API operations to MCP config
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import '@testing-library/jest-dom'
|
||||
import Header from './Header'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
|
||||
// Mock Next.js Link component
|
||||
jest.mock('next/link', () => {
|
||||
return ({ children, href }: { children: React.ReactNode; href: string }) => (
|
||||
<a href={href}>{children}</a>
|
||||
)
|
||||
})
|
||||
|
||||
describe('Header', () => {
|
||||
it('should render the company logo', () => {
|
||||
render(<Header />)
|
||||
expect(screen.getByText('mozdIT Bt.')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should render all navigation links in desktop menu', () => {
|
||||
render(<Header />)
|
||||
|
||||
// Desktop menu should contain all links with specific structures
|
||||
const desktopMenu = document.querySelector('.hidden.md\\:block')
|
||||
expect(desktopMenu).toBeInTheDocument()
|
||||
|
||||
const navLinks = screen.getAllByText('Kezdőlap')
|
||||
expect(navLinks.length).toBeGreaterThan(0)
|
||||
|
||||
expect(screen.getAllByText('Rólunk')).toHaveLength(2) // Both in desktop and mobile menus
|
||||
expect(screen.getAllByText('Szolgáltatások')).toHaveLength(2) // Both in desktop and mobile menus
|
||||
})
|
||||
|
||||
it('should render contact button with correct styling', () => {
|
||||
render(<Header />)
|
||||
|
||||
const contactButtons = screen.getAllByText('Kapcsolat')
|
||||
expect(contactButtons.length).toBeGreaterThan(0)
|
||||
|
||||
// Check if any contact button has the correct styling
|
||||
const contactButton = contactButtons[0]
|
||||
expect(contactButton).toBeInTheDocument()
|
||||
|
||||
// Check for blue background styling
|
||||
const contactLink = contactButton.closest('a')
|
||||
if (contactLink) {
|
||||
expect(contactLink).toHaveClass('bg-blue-600')
|
||||
}
|
||||
})
|
||||
|
||||
it('should render hamburger menu button on mobile', () => {
|
||||
render(<Header />)
|
||||
|
||||
// The hamburger menu button is hidden by default in desktop view
|
||||
// We can test its presence even if not visible
|
||||
const hamburgerButton = screen.getByRole('button')
|
||||
expect(hamburgerButton).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should have proper accessibility attributes', () => {
|
||||
render(<Header />)
|
||||
|
||||
const hamburgerButton = screen.getByRole('button')
|
||||
expect(hamburgerButton).toHaveAttribute('aria-expanded', 'false')
|
||||
})
|
||||
|
||||
it('should render with proper semantic structure', () => {
|
||||
const { container } = render(<Header />)
|
||||
|
||||
// Should have header element with proper structure
|
||||
const header = container.firstChild as HTMLElement
|
||||
expect(header?.tagName).toBe('HEADER')
|
||||
|
||||
// Should have a nav element
|
||||
const nav = container.querySelector('nav')
|
||||
expect(nav).toBeInTheDocument()
|
||||
|
||||
// Should be sticky positioned
|
||||
expect(header).toHaveClass('sticky', 'top-0')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user