import { render, screen } from '@testing-library/react'; import { describe, it, expect } from 'vitest'; import { Header } from '../Header'; describe('
', () => { it('renders the wordmark, linked to the top of the page', () => { render(
); const home = screen.getByRole('link', { name: /creeer/i }); expect(home).toHaveAttribute('href', '#top'); expect(home.querySelector('[data-accent="true"]')).not.toBeNull(); }); it('renders a persistent CTA linking to the contact section', () => { render(
); const cta = screen.getByRole('link', { name: /Hablemos/i }); expect(cta).toHaveAttribute('href', '#contacto'); }); it('shows reading progress', () => { const { container } = render(
); expect(container.querySelector('.bg-dorado')).toBeInTheDocument(); }); it('starts roomy, before any scrolling has happened', () => { const { container } = render(
); // The header compacts on scroll; at rest it must be in its tall state, or // the wordmark would land already shrunken on first paint. expect(container.querySelector('header')?.className).toContain('py-3'); }); });