fix(production) : prevent hydration and service failures

This commit is contained in:
2026-09-29 16:28:15 +07:00 Unverified
parent c6f0428aa7
commit 76478fe56d
6 changed files with 37 additions and 12 deletions
+15
View File
@@ -72,6 +72,8 @@ describe("public rendering performance", () => {
expect(adsense).not.toContain('from "@/lib/auth/client"');
expect(adsense).toContain('process.env.NODE_ENV !== "production"');
expect(adsense).toContain("pagead2.googlesyndication.com");
expect(adsense).toContain("<script");
expect(adsense).not.toContain('from "next/script"');
expect(home).toContain("<GoogleAdsense />");
expect(guide).toContain("<GoogleAdsense />");
expect(guideSection).toContain("<GoogleAdsense />");
@@ -79,4 +81,17 @@ describe("public rendering performance", () => {
"google.com, pub-9687404323559597, DIRECT, f08c47fec0942fa0",
);
});
it("allows the production analytics and advertising endpoints", async () => {
const headers = await repositoryFile("lib/security/headers.ts");
expect(headers).toContain("https://static.cloudflareinsights.com");
expect(headers).toContain("https://*.adtrafficquality.google");
});
it("accepts Next.js deployment metadata on the document root", async () => {
const layout = await repositoryFile("app/layout.tsx");
expect(layout).toContain("suppressHydrationWarning");
});
});