import { render, screen } from "@testing-library/react"; import type { ReactNode } from "react"; import Hero from "./Hero"; jest.mock("framer-motion", () => { const React = require("react"); const motion = new Proxy( {}, { get: (_, tag: string) => { const Component = ({ children, ...props }: { children?: ReactNode } & Record) => React.createElement(tag, props, children); Component.displayName = `motion.${tag}`; return Component; }, }, ); return { AnimatePresence: ({ children }: { children: React.ReactNode }) => children, motion, useInView: () => true, useReducedMotion: () => false, }; }); describe("Hero", () => { it("renders the upgraded hero content and primary actions", () => { render(); expect(screen.getByLabelText("evandro.dev.br")).toBeInTheDocument(); expect( screen.getByText( /Engenharia de software para produtos conectados, interfaces de alta performance e sistemas criticos/i, ), ).toBeInTheDocument(); expect(screen.getByText(/Iniciar projeto/i)).toBeInTheDocument(); expect(screen.getByText(/Ver projetos/i)).toBeInTheDocument(); expect(screen.getByText(/Download CV/i)).toBeInTheDocument(); expect(screen.getByText(/Execution Brief/i)).toBeInTheDocument(); }); it("renders social links and proof content", () => { render(); expect(screen.getAllByLabelText("GitHub").length).toBeGreaterThan(0); expect(screen.getAllByLabelText("LinkedIn").length).toBeGreaterThan(0); expect(screen.getAllByLabelText("Email").length).toBeGreaterThan(0); expect(screen.getByText(/Garuva, SC \/ Brasil/i)).toBeInTheDocument(); expect(screen.getByText(/Especialidade/i)).toBeInTheDocument(); expect(screen.getByText(/Escopo/i)).toBeInTheDocument(); expect(screen.getByText(/Formato/i)).toBeInTheDocument(); expect(screen.getByText(/Scroll/i)).toBeInTheDocument(); }); });