",
- "nodeLabel": "⟨/⟩\nMotionCode\nFeatures\nHow it Works\nTry Free\nMOTION INTELLIGENCE PLATFORM\nTurn…"
- }
- }
- ]
- }
- },
- {
- "node": {
- "type": "node",
- "lhId": "1-13-A",
- "path": "1,HTML,1,BODY,0,DIV,0,DIV,5,FOOTER,1,DIV,1,DIV,1,A",
- "selector": "footer.border-t > div.max-w-7xl > div.flex > a.hover:text-[#fffbf4]",
- "boundingRect": {
- "top": 3203,
- "bottom": 3223,
- "left": 214,
- "right": 260,
- "width": 46,
- "height": 20
- },
- "snippet": "
",
- "nodeLabel": "GitHub",
- "explanation": "Fix any of the following:\n Element has insufficient color contrast of 3.84 (foreground color: #747165, background color: #11120d, font size: 10.5pt (14px), font weight: normal). Expected contrast ratio of 4.5:1"
- },
- "subItems": {
- "type": "subitems",
- "items": [
- {
- "relatedNode": {
- "type": "node",
- "lhId": "1-2-DIV",
- "path": "1,HTML,1,BODY,0,DIV,0,DIV",
- "selector": "body.antialiased > div.h-full > div.min-h-screen",
- "boundingRect": {
- "top": 0,
- "bottom": 3255,
- "left": 0,
- "right": 412,
- "width": 412,
- "height": 3255
- },
- "snippet": "",
- "nodeLabel": "⟨/⟩\nMotionCode\nFeatures\nHow it Works\nTry Free\nMOTION INTELLIGENCE PLATFORM\nTurn…"
- }
- }
- ]
- }
- }
- ],
- "debugData": {
- "type": "debugdata",
- "impact": "serious",
- "tags": [
- "cat.color",
- "wcag2aa",
- "wcag143",
- "TTv5",
- "TT13.c",
- "EN-301-549",
- "EN-9.1.4.3",
- "ACT",
- "RGAAv4",
- "RGAA-3.2.1"
- ]
- }
- }
- },
- "definition-list": {
- "id": "definition-list",
- "title": "`
`'s contain only properly-ordered `- ` and `
- ` groups, `")).toBe(
+ "<script>alert('&')</script>"
+ );
+ });
+
+ it("returns stable file names per tab", () => {
+ expect(fileNameForTab("CSS")).toBe("animation.css");
+ expect(fileNameForTab("GSAP")).toBe("animation.gsap.js");
+ expect(fileNameForTab("Framer Motion")).toBe("AnimatedComponent.tsx");
+ expect(fileNameForTab("React Spring")).toBe("AnimatedComponent.tsx");
+ });
+});
diff --git a/tests/unit/securityHeaders.test.ts b/tests/unit/securityHeaders.test.ts
new file mode 100644
index 0000000..7da2076
--- /dev/null
+++ b/tests/unit/securityHeaders.test.ts
@@ -0,0 +1,68 @@
+import nextConfig from "../../next.config.mjs";
+import { describe, expect, it } from "vitest";
+
+type SecurityHeader = {
+ key: string;
+ value: string;
+};
+
+type HeaderRoute = {
+ source: string;
+ headers: SecurityHeader[];
+};
+
+type HeaderConfig = {
+ headers?: () => HeaderRoute[] | Promise;
+};
+
+async function readGlobalHeaders(): Promise