Files
portifolio-evandrodevbr/app/ia/page.test.tsx
T
Evandro Fonseca Junior 8d07b8c6bb feat(home): prova no topo, contato sem atrito e conversão medida
Home mais curta (hero, vitrine de clientes, sobre, serviços, IA resumida, depoimentos e contato), faixa de clientes e telas reais no hero, sem números do GitHub. Barra de cookies fina, WhatsApp fixo no celular, formulário com e-mail opcional e alternativa por e-mail, página /ia, eventos de e-mail, redes e currículo e conversão do Ads opcional por variável. Rodapé em 3 colunas. Remove componentes órfãos (LighthouseMetrics, Skills, Experience, contagem do GitHub).
2026-10-14 03:32:23 -03:00

69 lines
2.3 KiB
TypeScript

import { render, screen, within } from "@testing-library/react";
import AiPage, { metadata } from "./page";
it("uses its own title without the site suffix being added twice", () => {
expect(metadata.title).toEqual({
absolute:
"Começou um sistema com IA? Revisão e continuidade | Evandro Fonseca Junior",
});
expect(metadata).toMatchObject({
description: expect.any(String),
alternates: { canonical: "https://evandro.dev.br/ia" },
});
});
it("keeps the full AI content, with the cited incidents summarized only here", () => {
render(<AiPage />);
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent(
"Começou um sistema com IA? Dá para partir daí.",
);
for (const heading of [
"Se a IA cria um sistema, por que contratar um desenvolvedor?",
"O que casos documentados ensinam",
"E a LGPD?",
]) {
expect(screen.getByRole("heading", { name: heading })).toBeInTheDocument();
}
for (const incident of [/Lovable/, /Replit/, /Base44/]) {
expect(screen.getByRole("heading", { name: incident })).toBeInTheDocument();
}
expect(
screen.getByRole("link", { name: "Reportagem da Semafor (em inglês)" }),
).toHaveAttribute("rel", "noopener noreferrer");
});
it("offers WhatsApp conversations about reviewing an AI-built system", () => {
render(<AiPage />);
const links = screen
.getAllByRole("link")
.filter((link) => link.getAttribute("href")?.startsWith("https://wa.me/"));
expect(links.map((link) => link.textContent)).toEqual([
"Falar sobre meu sistema",
"Avaliar meu projeto",
]);
for (const link of links) {
const text = new URL(link.getAttribute("href") ?? "").searchParams.get(
"text",
);
// a mensagem tem de formar uma frase: "Quero conversar sobre a revisão de um sistema feito com IA."
expect(text).toContain(
"Quero conversar sobre a revisão de um sistema feito com IA.",
);
}
});
it("has breadcrumb navigation back to the home", () => {
render(<AiPage />);
const breadcrumb = screen.getByRole("navigation", { name: "Breadcrumb" });
expect(
within(breadcrumb).getByRole("link", { name: "Início" }),
).toHaveAttribute("href", "/");
expect(within(breadcrumb).getByText("IA no desenvolvimento")).toHaveAttribute(
"aria-current",
"page",
);
});