import { describe, expect, it } from "vitest";
import {
  contactPageJsonLd,
  organizationJsonLd,
  websiteJsonLd,
} from "./json-ld";

describe("json-ld.ts", () => {
  describe("organizationJsonLd", () => {
    it("returns Organization schema with required fields", () => {
      const data = organizationJsonLd();
      expect(data["@context"]).toBe("https://schema.org");
      expect(data["@type"]).toBe("Organization");
      expect(data.name).toBe("Jenado Unlimited");
      expect(typeof data.description).toBe("string");
      expect(typeof data.url).toBe("string");
    });
  });

  describe("contactPageJsonLd", () => {
    it("returns ContactPage schema", () => {
      const data = contactPageJsonLd();
      expect(data["@context"]).toBe("https://schema.org");
      expect(data["@type"]).toBe("ContactPage");
      expect(data.name).toBe("Contact Us");
      expect(typeof data.description).toBe("string");
    });
  });

  describe("websiteJsonLd", () => {
    it("returns WebSite schema", () => {
      const data = websiteJsonLd();
      expect(data["@context"]).toBe("https://schema.org");
      expect(data["@type"]).toBe("WebSite");
      expect(data.name).toBe("Jenado Unlimited");
      expect(typeof data.url).toBe("string");
    });
  });
});
