import { describe, expect, it } from "vitest";
import { siteSettingsSchema } from "./site-settings";

describe("siteSettingsSchema", () => {
  it("accepts a valid site settings object", () => {
    const result = siteSettingsSchema.parse({
      siteName: "My Site",
      siteDescription: "A great site",
    });
    expect(result.siteName).toBe("My Site");
    expect(result.siteDescription).toBe("A great site");
  });

  it("accepts site settings without a description", () => {
    const result = siteSettingsSchema.parse({ siteName: "My Site" });
    expect(result.siteName).toBe("My Site");
    expect(result.siteDescription).toBeUndefined();
  });

  it("rejects an empty siteName", () => {
    expect(() => siteSettingsSchema.parse({ siteName: "" })).toThrow();
  });
});
