feat(servicos): topo, entregáveis e cases por serviço, assunto próprio no WhatsApp e títulos curtos

This commit is contained in:
Evandro Fonseca Junior committed 2026-10-14 22:54:18 -03:00
1 parent cf360041bd
commit 2fd8b063d9
33 files changed
+1578 -300

No files matched your search

+26 -6
View File
@@ -1,18 +1,24 @@
import { render, screen, within } from "@testing-library/react";
import { offerLabels } from "@/lib/offer-labels";
import AiPage, { metadata } from "./page";
it("uses a short search title: with the layout suffix it fits in 44 characters", () => {
it("uses a short search title: up to 44 characters, and 60 with the layout suffix", () => {
// o template de app/layout.tsx acrescenta " | Evandro.dev.br"
const suffix = " | Evandro.dev.br";
expect(metadata.title).toBe("Revisão de app feito com IA");
expect(`${metadata.title}${suffix}`.length).toBeLessThanOrEqual(44);
expect(metadata.title).toBe("Revisão de sistema e de app feito com IA");
expect(String(metadata.title).length).toBeLessThanOrEqual(44);
expect(`${metadata.title}${suffix}`.length).toBeLessThanOrEqual(60);
expect(metadata).toMatchObject({
description: expect.any(String),
alternates: { canonical: "https://evandro.dev.br/ia" },
});
// como nas outras páginas, o título da prévia de compartilhamento é o mesmo da busca, sem o sufixo
expect(metadata.openGraph?.title).toBe("Revisão de app feito com IA");
expect(metadata.twitter?.title).toBe("Revisão de app feito com IA");
expect(metadata.openGraph?.title).toBe(
"Revisão de sistema e de app feito com IA",
);
expect(metadata.twitter?.title).toBe(
"Revisão de sistema e de app feito com IA",
);
});
it("uses no lime outside the contact actions (the quote on the paper background is ink)", () => {
@@ -75,7 +81,7 @@ it("has breadcrumb navigation back to the home", () => {
within(breadcrumb).getByRole("link", { name: "Início" }),
).toHaveAttribute("href", "/");
expect(
within(breadcrumb).getByText("Revisão de app feito com IA"),
within(breadcrumb).getByText(offerLabels.revisao.name),
).toHaveAttribute("aria-current", "page");
});
@@ -232,3 +238,17 @@ it("keeps the incident news collapsed in a <details>, closed by default", () =>
.closest("details"),
).toBeNull();
});
it("names the review like the offer on the home: the trail and the structured data use the offer name, not the search title", () => {
const { container } = render(<AiPage />);
const script = container.querySelector('script[type="application/ld+json"]');
const data = JSON.parse(script?.textContent ?? "{}");
const breadcrumb = data["@graph"].find(
(node: { "@type": string }) => node["@type"] === "BreadcrumbList",
);
expect(
breadcrumb.itemListElement.map(({ name }: { name: string }) => name),
).toEqual(["Início", offerLabels.revisao.name]);
expect(offerLabels.revisao.name).toBe("Revisão de sistema que já existe");
});