import { describe, expect, it } from "vitest";
import { {{camelCase entity}}Schema } from "./{{kebabCase entity}}";

describe("{{camelCase entity}}Schema", () => {
  it("accepts a valid {{camelCase entity}}", () => {
    const result = {{camelCase entity}}Schema.parse({ id: "1", name: "Example" });
    expect(result.id).toBe("1");
    expect(result.name).toBe("Example");
  });

  it("rejects an empty id", () => {
    expect(() => {{camelCase entity}}Schema.parse({ id: "", name: "ok" })).toThrow();
  });

  it("rejects an empty name", () => {
    expect(() => {{camelCase entity}}Schema.parse({ id: "1", name: "" })).toThrow();
  });

  it("rejects a name over 128 chars", () => {
    expect(() =>
      {{camelCase entity}}Schema.parse({ id: "1", name: "x".repeat(129) }),
    ).toThrow();
  });
});
