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.
57 lines
2.1 KiB
TypeScript
57 lines
2.1 KiB
TypeScript
import { render, screen } from "@testing-library/react";
|
|
import NotFound, { metadata } from "./not-found";
|
|
|
|
describe("not-found", () => {
|
|
it("has no canonical (the home one does not apply to a 404) and no generic robots tag of its own", () => {
|
|
// o Next já escreve <meta name="robots" content="noindex"> no 404: repeti-lo duplicaria a tag
|
|
expect(metadata.alternates).toEqual({ canonical: null });
|
|
expect(metadata.robots).not.toHaveProperty("index");
|
|
expect(metadata.robots).not.toHaveProperty("follow");
|
|
});
|
|
|
|
it("has its own Open Graph and Twitter card, with no url (the home one does not apply to a page that does not exist)", () => {
|
|
expect(metadata.openGraph).toEqual({
|
|
locale: "pt_BR",
|
|
title: "Página não encontrada",
|
|
description: "A página que você procura não existe ou foi movida.",
|
|
siteName: "Evandro.dev.br",
|
|
type: "website",
|
|
});
|
|
expect(metadata.openGraph).not.toHaveProperty("url");
|
|
expect(metadata.twitter).toMatchObject({
|
|
card: "summary_large_image",
|
|
title: "Página não encontrada",
|
|
description: "A página que você procura não existe ou foi movida.",
|
|
});
|
|
expect(metadata.twitter).not.toHaveProperty("url");
|
|
});
|
|
|
|
it("keeps Googlebot out, since the root layout lets it index", () => {
|
|
expect(metadata.robots).toEqual({
|
|
googleBot: { index: false, follow: false },
|
|
});
|
|
});
|
|
|
|
it("explains the problem and offers a way back, in Portuguese", () => {
|
|
render(<NotFound />);
|
|
|
|
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("404");
|
|
expect(
|
|
screen.getByRole("heading", { level: 2, name: "Página não encontrada" }),
|
|
).toBeVisible();
|
|
expect(
|
|
screen.getByRole("link", { name: "Voltar ao início" }),
|
|
).toHaveAttribute("href", "/");
|
|
expect(screen.getByRole("link", { name: "Ver os cases" })).toHaveAttribute(
|
|
"href",
|
|
"/cases",
|
|
);
|
|
});
|
|
|
|
it("uses no lime: the lime is only for the contact action", () => {
|
|
const { container } = render(<NotFound />);
|
|
|
|
expect(container.innerHTML).not.toMatch(/slash|ccff00/i);
|
|
});
|
|
});
|