Files
portifolio-evandrodevbr/app/privacidade/page.test.tsx
T
evandro c7d09d63d4
CI / audit (push) Successful in 10m38s
CI / verify (push) Successful in 13m10s
CI / deploy (push) Successful in 1m50s
CI / e2e (push) Successful in 18m48s
feat(site): blocos 3D da marca, novas ofertas e hero mais abrangente
Hero e movimento
- cena 3D em tempo real com os blocos da marca (kit feito no Blender, 3d/blocos.py):
  marca, tela, integrações e dados; segue a rolagem, tem vida em repouso, reage ao
  cursor e, parada no topo, passa sozinha pelos estados com legenda
- três níveis de aparelho (full, lite, static); sem WebGL fica o pôster
- título novo: "Sites e sistemas sob medida para o jeito que a sua empresa trabalha."
- faixa de clientes com o ramo, linha do primeiro passo, hero alinhado às seções
- rótulos digitados, entrada dos blocos, cortina de blocos entre páginas e capa
  compartilhada entre a lista de cases e o case

Ofertas
- atendimento no WhatsApp com IA e nota fiscal para a reforma tributária
  (páginas de serviço, cartões da home, formulário e aviso com data de validade)
- página /ia atualizada, com fontes
- peças 3D em loop nos cartões e topos de página (3d/pecas.py)

Design
- hover por papel (bloco nos botões, barra nos links), rótulos sem caixa alta
- um destino por rótulo: "Falar sobre meu projeto" leva ao formulário,
  "Chamar no WhatsApp" abre o WhatsApp
- logo montado em blocos, 404 redesenhado, grades sem célula vazia
- ícones do PWA e manifesto novos

Specs em specs/, contexto de design em DESIGN.md e PRODUCT.md.
2026-11-10 03:48:25 -03:00

94 lines
3.3 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 strip as the other inner pages, with the decorative block piece beside the text from 1024 px", () => {
const { container } = render(<PrivacyPage />);
const hero = container.querySelector("section");
expect(hero?.className).toContain("md:!pb-sp-12");
// a trilha também tem aria-hidden (as barras): a peça é a dona da imagem
const image = hero?.querySelector("img");
expect(image?.getAttribute("src")).toContain("estado-dados.webp");
expect(image?.closest('[aria-hidden="true"]')).toHaveClass(
"hidden",
"lg:block",
);
});
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" },
});
});