Files
Evandro Fonseca Junior de6af74a0c feat(cases): prova certa por serviço, páginas internas com trabalho no topo
Diagnóstico sem case que não cabe; desktop com o GCC Installer como projeto próprio; IoT com o Twins Lab e a nota da Apolo. Mosaico de pôsteres em /servicos e /cases, faixa baixa em uma coluna no currículo, privacidade e laboratório; Laboratório como lista compacta; SEV começando por catálogo, pedido no WhatsApp e painel; Joinville e SC nos títulos; imagens do LCP com fetchPriority e sizes reais; pré-carregamento só no hover; 404 com Open Graph próprio.
2026-10-14 17:01:35 -03:00

88 lines
3.0 KiB
TypeScript

import { render, screen, within } from "@testing-library/react";
import PrivacyPage, { metadata } from "./page";
it("preserves breadcrumb navigation and a breadcrumb-only JSON-LD graph", () => {
const { container } = render(<PrivacyPage />);
const breadcrumb = screen.getByRole("navigation", {
name: "Trilha de navegação",
});
const breadcrumbLinks = within(breadcrumb).getAllByRole("link");
expect(breadcrumbLinks.map((link) => link.textContent)).toEqual([
"Início",
"Privacidade",
]);
expect(breadcrumbLinks[0]).toHaveAttribute("href", "/");
expect(breadcrumbLinks[1]).toHaveAttribute("href", "/privacidade");
expect(breadcrumbLinks[1]).toHaveAttribute("aria-current", "page");
const scripts = container.querySelectorAll<HTMLScriptElement>(
'script[type="application/ld+json"]',
);
expect(scripts).toHaveLength(1);
const jsonLd = JSON.parse(scripts[0]?.textContent ?? "{}");
expect(jsonLd["@graph"]).toHaveLength(1);
expect(jsonLd["@graph"][0]["@type"]).toBe("BreadcrumbList");
expect(JSON.stringify(jsonLd)).not.toMatch(
/Person|Organization|LocalBusiness|ProfessionalService|Service/,
);
expect(jsonLd["@graph"][0].itemListElement).toEqual([
{
"@type": "ListItem",
position: 1,
name: "Início",
item: "https://evandro.dev.br",
},
{
"@type": "ListItem",
position: 2,
name: "Privacidade",
item: "https://evandro.dev.br/privacidade",
},
]);
});
it("mentions no GitHub link and no English jargon in the visible text", () => {
const { container } = render(<PrivacyPage />);
expect(container.textContent).not.toMatch(/github/i);
expect(container.textContent).not.toMatch(/\b(loader|endpoint)\b/i);
for (const link of screen.getAllByRole("link")) {
expect(link.getAttribute("href")).not.toMatch(/github/i);
}
});
it("uses the same shell as the home, with no narrow max-width", () => {
const { container } = render(<PrivacyPage />);
const shells = container.querySelectorAll(".ds-section-shell");
expect(shells.length).toBeGreaterThan(0);
for (const shell of shells) {
expect(shell.className).not.toMatch(/max-w-/);
}
// o sufixo " | Evandro.dev.br" vem do layout: o título não o repete
expect(metadata.title).toBe("Privacidade e consentimento");
});
it("opens with the same lower one-column strip as the other inner pages", () => {
const { container } = render(<PrivacyPage />);
const hero = container.querySelector("section");
expect(hero?.className).toContain("md:!pb-sp-12");
expect(hero?.querySelector(".ds-section-shell")).not.toHaveClass("grid");
});
it("keeps the lime fill for contact actions only", () => {
const { container } = render(<PrivacyPage />);
expect(container.querySelector(".ds-link-accent")).toBeNull();
});
it("uses privacy-specific canonical metadata", () => {
expect(metadata).toMatchObject({
title: expect.stringMatching(/privacidade/i),
description: expect.any(String),
alternates: { canonical: "https://evandro.dev.br/privacidade" },
});
});