Files
Evandro Fonseca Junior 08dd046887 feat: add animated components for enhanced UI/UX
- Introduced DrawLine component for drawing animations.
- Added LazyRevealImage component for lazy loading images with reveal animations.
- Implemented TextDiffuseReveal for animated text reveals with staggered effects.
- Created TopProgressBar for a dynamic loading indicator.
- Added PointCloud mock for testing animations.
- Developed useReducedMotion hook to handle user preferences for reduced motion.
- Centralized animation configurations in config.ts for easier management.
- Defined animation variants in variants.ts for consistent animation effects.
- Established AnimationProvider to supply global animation settings.
- Created tests for AnimationProvider and useReducedMotion hook.
- Added SVG assets for branding and UI elements.
- Documented frontend review plan and hero circuit board animation plan.
2026-03-15 21:06:43 -03:00

63 lines
2.0 KiB
TypeScript

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<string, unknown>) =>
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(<Hero />);
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(<Hero />);
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();
});
});