CI / verify (push) Failing after 5m43s
- Biome: formatacao, ordem de imports, max-width duplicado no cabecalho de secao, supressao justificada para nomes de view-transition, ajustes nos scripts de auditoria de SEO - next 16.3.3 -> 16.3.8: GHSA-vcvr-r3jv-pc5j (execucao remota de codigo em next/og ImageResponse, usado nas imagens de compartilhamento) - overrides de brace-expansion (GHSA-qhr7-859c-m2p7, GHSA-6j4f-fj2g-mc7p, GHSA-q2hr-2g5m-vwhr), dependencia de desenvolvimento via jest - visibilidade das cenas le as posicoes a cada quadro e o GSAP remede as passagens quando a pagina muda de altura (fontes, imagens, Experiencia) Co-Authored-By: Claude Opus 5.5 <[email protected]>
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { render, screen } from "@testing-library/react";
|
|
|
|
import { TextDiffuseReveal } from "./TextDiffuseReveal";
|
|
|
|
let mockInView = false;
|
|
jest.mock("motion/react", () => ({ useInView: () => mockInView }));
|
|
|
|
describe("TextDiffuseReveal", () => {
|
|
beforeEach(() => {
|
|
mockInView = false;
|
|
});
|
|
|
|
it("keeps the whole sentence readable once for assistive technology", () => {
|
|
const { container } = render(
|
|
<TextDiffuseReveal text="Software feito a partir do seu negócio" />,
|
|
);
|
|
|
|
expect(
|
|
screen.getByText("Software feito a partir do seu negócio"),
|
|
).toHaveClass("sr-only");
|
|
const words = container.querySelectorAll(".text-reveal-word");
|
|
expect(words).toHaveLength(7);
|
|
expect(words[0].closest("[aria-hidden='true']")).not.toBeNull();
|
|
});
|
|
|
|
it("marks the title as shown only after it enters the viewport", () => {
|
|
const { container, rerender } = render(
|
|
<TextDiffuseReveal text="Reveal me" />,
|
|
);
|
|
expect(container.querySelector(".text-reveal")).not.toHaveAttribute(
|
|
"data-shown",
|
|
);
|
|
|
|
mockInView = true;
|
|
rerender(<TextDiffuseReveal text="Reveal me" />);
|
|
expect(container.querySelector(".text-reveal")).toHaveAttribute(
|
|
"data-shown",
|
|
);
|
|
});
|
|
});
|