Hero: replace particle field with cobe globe (Capricorn view, multi-axis drag, reduced-motion safe), telemetry HUD with pointer parallax, particle text build effect, Space Grotesk display font. SEO: short titles with template, PT-BR accents, twitter cards on dynamic cases, escaped JSON-LD via lib/jsonld.ts, CSP report-only, 25 service FAQs answer-first. Design: fix TW4 layered reset killing spacing utilities, literal @theme tokens, mobile hero overflow, header overlap, empty case cards. Remove framer-motion (unified on motion/react), header version badge, phone number from hero CTA. Production build verified (24 static pages).
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { render } from "@testing-library/react";
|
|
import type { ReactNode } from "react";
|
|
import MagneticButton from "./MagneticButton";
|
|
|
|
jest.mock("motion/react", () => {
|
|
const React = require("react");
|
|
|
|
const motion = new Proxy(
|
|
{},
|
|
{
|
|
get: (_, tag: string) => {
|
|
const Component = ({
|
|
children,
|
|
animate: _animate,
|
|
transition: _transition,
|
|
...props
|
|
}: { children?: ReactNode } & Record<string, unknown>) =>
|
|
React.createElement(tag, props, children);
|
|
Component.displayName = `motion.${tag}`;
|
|
return Component;
|
|
},
|
|
},
|
|
);
|
|
|
|
return { motion };
|
|
});
|
|
|
|
describe("MagneticButton semantics", () => {
|
|
it("renders a list item directly when used inside a list", () => {
|
|
const { container } = render(
|
|
<ul>
|
|
<MagneticButton as="li" className="ds-tag">
|
|
TypeScript
|
|
</MagneticButton>
|
|
</ul>,
|
|
);
|
|
|
|
expect(container.querySelector("ul > li.ds-tag")).toBeInTheDocument();
|
|
expect(container.querySelector("ul > div > li")).not.toBeInTheDocument();
|
|
});
|
|
});
|