diff --git a/app/page.tsx b/app/page.tsx index d43a5de..37afbf1 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,9 +1,11 @@ import { Hero } from '@/components/sections/Hero'; +import { FraseAncla } from '@/components/sections/FraseAncla'; export default function Home() { return (
+
); } diff --git a/components/sections/FraseAncla.tsx b/components/sections/FraseAncla.tsx new file mode 100644 index 0000000..0596904 --- /dev/null +++ b/components/sections/FraseAncla.tsx @@ -0,0 +1,27 @@ +'use client'; + +import { motion } from 'framer-motion'; +import { Container } from '@/components/primitives/Container'; +import { fraseAncla } from '@/lib/content'; +import { fadeInUp, viewportOnce } from '@/lib/motion'; + +export function FraseAncla() { + return ( +
+ + + “ + {fraseAncla.quote.before}{' '} + {fraseAncla.quote.accent} + ” + + +
+ ); +} diff --git a/components/sections/__tests__/FraseAncla.test.tsx b/components/sections/__tests__/FraseAncla.test.tsx new file mode 100644 index 0000000..ccca774 --- /dev/null +++ b/components/sections/__tests__/FraseAncla.test.tsx @@ -0,0 +1,11 @@ +import { render, screen } from '@testing-library/react'; +import { describe, it, expect } from 'vitest'; +import { FraseAncla } from '../FraseAncla'; + +describe('', () => { + it('renders the anchor quote', () => { + render(); + expect(screen.getByText(/Las empresas no dejan de crecer/i)).toBeInTheDocument(); + expect(screen.getByText(/falta de claridad/i)).toBeInTheDocument(); + }); +}); diff --git a/lib/content.ts b/lib/content.ts index 52fccfe..3a87dbf 100644 --- a/lib/content.ts +++ b/lib/content.ts @@ -18,7 +18,11 @@ export const hero = { }; export const fraseAncla = { - quote: 'Las empresas no dejan de crecer por falta de talento; dejan de crecer por falta de claridad.', + // Quote split into parts so the second clause can render in gold. + quote: { + before: 'Las empresas no dejan de crecer por falta de talento;', + accent: 'dejan de crecer por falta de claridad.', // gold + }, }; export const paraQuien = { diff --git a/vitest.setup.ts b/vitest.setup.ts index bb02c60..d4fb523 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -1 +1,19 @@ import '@testing-library/jest-dom/vitest'; + +// jsdom lacks IntersectionObserver; Framer Motion's `whileInView` needs it. +if (typeof window !== 'undefined' && !('IntersectionObserver' in window)) { + class IntersectionObserverStub { + observe() {} + unobserve() {} + disconnect() {} + takeRecords() { + return []; + } + root = null; + rootMargin = ''; + thresholds = []; + } + // @ts-expect-error – installing stub on window + window.IntersectionObserver = IntersectionObserverStub; + global.IntersectionObserver = IntersectionObserverStub; +}