Files
Evandro Fonseca Junior 9e2d65a926 fix(home): oferta leva ao formulário, ofertas logo depois da vitrine
O botão das ofertas rola até o contato com o tipo marcado e não quebra mais as âncoras; ofertas com o que você recebe e primeiro passo, logo depois da vitrine; bloco de IA fora da home; cartão largo da SEV no hero do celular; separador da faixa de clientes só entre itens; favicon de 13 para 1,8 KB; pré-carregamento só no hover e nunca de /#... fora da home; X do menu e cabeçalho opaco; WhatsApp com "o case"; /ia com 3 passos e modelo de relatório ilustrativo; Sobre alinhado ao currículo; CSP Report-Only com os domínios do Ads.
2026-10-14 19:14:47 -03:00

49 lines
1.6 KiB
TypeScript

import { render, screen } from "@testing-library/react";
import type { Testimonial } from "@/lib/proof";
import { testimonials } from "@/lib/proof";
import Testimonials from "./Testimonials";
const item: Testimonial = {
quote: "Entregou no prazo combinado.",
name: "Maria Souza",
role: "Sócia",
company: "Empresa de Teste",
projectId: "lavacao-047",
};
it("renders nothing without testimonials", () => {
const { container } = render(<Testimonials items={[]} />);
expect(container).toBeEmptyDOMElement();
const withoutProp = render(<Testimonials />);
expect(withoutProp.container).toBeEmptyDOMElement();
});
it("ships with no testimonial until a real, authorized one is added", () => {
expect(testimonials).toEqual([]);
});
it("shows the quote, who said it and a link to the case", () => {
render(<Testimonials items={[item]} />);
expect(
screen.getByRole("heading", { name: "O que dizem os clientes." }),
).toBeInTheDocument();
expect(
screen.getByText("“Entregou no prazo combinado.”"),
).toBeInTheDocument();
expect(screen.getByText("Maria Souza")).toBeInTheDocument();
expect(screen.getByText("Sócia, Empresa de Teste")).toBeInTheDocument();
expect(screen.getByRole("link", { name: "Ver case" })).toHaveAttribute(
"href",
"/cases/lavacao-047",
);
});
it("falls back to initials without a photo and has no case link without a project", () => {
render(<Testimonials items={[{ ...item, projectId: undefined }]} />);
expect(screen.getByText("MS")).toBeInTheDocument();
expect(screen.queryByRole("link", { name: "Ver case" })).toBeNull();
});