feat: add allowed Linear API operations to MCP config
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
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('Email: info@mozdit.hu')).toBeInTheDocument()
|
||||
expect(screen.getByText('Cég: mozdIT Bt.')).toBeInTheDocument()
|
||||
expect(screen.getByText('Székhely: 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('Web Hosting')).toBeInTheDocument()
|
||||
expect(screen.getByText('Email Szolgáltatás')).toBeInTheDocument()
|
||||
expect(screen.getByText('DNS Adminisztráció')).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')
|
||||
|
||||
// Should have proper background and padding
|
||||
expect(footer).toHaveClass('bg-gray-50', 'border-t')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,79 @@
|
||||
import { siteConfig } from '@/config/site'
|
||||
|
||||
export default function Footer() {
|
||||
return (
|
||||
<footer className="bg-gray-50 border-t border-gray-200">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-8">
|
||||
{/* Company Info */}
|
||||
<div className="md:col-span-2">
|
||||
<h3 className="text-lg font-semibold text-gray-900 mb-4">
|
||||
{siteConfig.general.name}
|
||||
</h3>
|
||||
<p className="text-gray-600 mb-4 max-w-md">
|
||||
{siteConfig.general.description}
|
||||
</p>
|
||||
<div className="flex space-x-4">
|
||||
<div className="text-sm text-gray-500">
|
||||
<p>Email: {siteConfig.contact.email}</p>
|
||||
<p>Cég: {siteConfig.general.name}</p>
|
||||
<p>Székhely: {siteConfig.contact.address}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Navigation Links */}
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4">
|
||||
Navigáció
|
||||
</h3>
|
||||
<ul className="space-y-2">
|
||||
{siteConfig.navigation.footer.map((item) => (
|
||||
<li key={item.href}>
|
||||
<a href={item.href} className="text-gray-600 hover:text-blue-600 transition-colors">
|
||||
{item.label}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Services */}
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4">
|
||||
Szolgáltatások
|
||||
</h3>
|
||||
<ul className="space-y-2">
|
||||
{siteConfig.services.services.map((service) => (
|
||||
<li key={service.id} className="text-gray-600">
|
||||
{service.title}
|
||||
</li>
|
||||
))}
|
||||
<li className="text-gray-600">Műszaki támogatás</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Bottom section */}
|
||||
<div className="border-t border-gray-200 pt-8 mt-8">
|
||||
<div className="flex flex-col sm:flex-row justify-between items-center">
|
||||
<p className="text-gray-500 text-sm">
|
||||
{siteConfig.footer.copyright}
|
||||
</p>
|
||||
<div className="flex space-x-4 mt-4 sm:mt-0">
|
||||
{siteConfig.footer.links.map((link) => (
|
||||
<a
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
className="text-gray-500 hover:text-blue-600 text-sm transition-colors"
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -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')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,70 @@
|
||||
import { siteConfig } from '@/config/site'
|
||||
|
||||
export default function Header() {
|
||||
return (
|
||||
<header className="bg-white border-b border-gray-200 sticky top-0 z-50">
|
||||
<nav className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div className="flex justify-between items-center h-16">
|
||||
{/* Logo */}
|
||||
<div className="flex-shrink-0">
|
||||
<a href="/" className="text-xl font-bold text-blue-600 hover:text-blue-700">
|
||||
{siteConfig.general.name}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{/* Desktop Navigation */}
|
||||
<div className="hidden md:block">
|
||||
<div className="flex items-center space-x-8">
|
||||
{siteConfig.navigation.main.map((item) => (
|
||||
<a
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
target={item.external ? '_blank' : undefined}
|
||||
rel={item.external ? 'noopener noreferrer' : undefined}
|
||||
className={item.label === 'Kapcsolat'
|
||||
? "bg-blue-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-blue-700 transition-colors"
|
||||
: "text-gray-900 hover:text-blue-600 px-3 py-2 text-sm font-medium transition-colors"
|
||||
}
|
||||
>
|
||||
{item.label}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mobile menu button */}
|
||||
<div className="md:hidden">
|
||||
<button
|
||||
type="button"
|
||||
className="text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500"
|
||||
aria-expanded="false"
|
||||
>
|
||||
<span className="sr-only">Open main menu</span>
|
||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mobile Navigation - Hidden by default */}
|
||||
<div className="md:hidden absolute top-full left-0 right-0 bg-white border-b border-gray-200 shadow-lg opacity-0 invisible transition-all duration-300 ease-in-out">
|
||||
<div className="px-2 pt-2 pb-3 space-y-1">
|
||||
<a href="/" className="block px-3 py-2 rounded-md text-base font-medium text-gray-900 hover:text-blue-600">
|
||||
Kezdőlap
|
||||
</a>
|
||||
<a href="/rolunk" className="block px-3 py-2 rounded-md text-base font-medium text-gray-900 hover:text-blue-600">
|
||||
Rólunk
|
||||
</a>
|
||||
<a href="/szolgaltatasok" className="block px-3 py-2 rounded-md text-base font-medium text-gray-900 hover:text-blue-600">
|
||||
Szolgáltatások
|
||||
</a>
|
||||
<a href="/kapcsolat" className="block px-3 py-2 rounded-md text-base font-medium bg-blue-600 text-white">
|
||||
Kapcsolat
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user