Refresh HiveGrid Cloud reference snapshot

This commit is contained in:
david committed 2026-08-03 15:31:14 +02:00
1 parent 5e99e14772
commit 7f88026f79
5955 files changed
+1177325 -188362

No files matched your search

@@ -1,56 +1,14 @@
import { describe, expect, it } from "vitest";
import { readFileSync, statSync } from "node:fs";
import { gzipSync } from "node:zlib";
import { fileURLToPath } from "node:url";
// @vitest-environment node
import { existsSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
const here = dirname(fileURLToPath(import.meta.url));
const sdkPath = join(here, "..", "public", "embed", "marketing.js");
describe("marketing.js SDK", () => {
it("is checked into apps/web/public/embed/marketing.js", () => {
expect(statSync(sdkPath).isFile()).toBe(true);
});
it("stays under the 3KB gzipped budget", () => {
const raw = readFileSync(sdkPath);
const gz = gzipSync(raw);
expect(gz.byteLength).toBeLessThan(3 * 1024);
});
it("stays under the 5KB raw budget", () => {
const raw = readFileSync(sdkPath);
expect(raw.byteLength).toBeLessThan(5 * 1024);
});
it("references the capture endpoint path", () => {
const text = readFileSync(sdkPath, "utf8");
expect(text).toContain("/api/leads/capture");
});
it("exposes the hivegridMarketing global with the documented surface", () => {
const text = readFileSync(sdkPath, "utf8");
expect(text).toContain("hivegridMarketing");
expect(text).toContain("captureLead");
expect(text).toContain("bindFormById");
expect(text).toContain("getAttribution");
});
it("auto-captures the documented UTM/click-id parameters", () => {
const text = readFileSync(sdkPath, "utf8");
for (const k of ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content", "gclid", "fbclid"]) {
expect(text).toContain(k);
}
});
it("persists first-touch attribution in localStorage", () => {
const text = readFileSync(sdkPath, "utf8");
expect(text).toContain("localStorage");
expect(text).toContain("__tcm_attr");
});
it("includes a honeypot field name compatible with the capture endpoint", () => {
const text = readFileSync(sdkPath, "utf8");
expect(text).toContain("website_url");
describe("retired marketing.js SDK", () => {
it("is no longer shipped as an active browser lead writer", () => {
expect(existsSync(sdkPath)).toBe(false);
});
});