import { createQuotationSchema } from "@/lib/validators/quotations.validator";

describe("createQuotationSchema - sendImmediately", () => {
  it("accepts sendImmediately: true", () => {
    const result = createQuotationSchema.safeParse({
      title: "Test",
      items: [],
      sendImmediately: true,
    });
    expect(result.success).toBe(true);
    expect(result.data?.sendImmediately).toBe(true);
  });

  it("defaults sendImmediately to true when omitted", () => {
    const result = createQuotationSchema.safeParse({
      title: "Test",
      items: [],
    });
    expect(result.success).toBe(true);
    expect(result.data?.sendImmediately).toBe(true);
  });

  it("accepts sendImmediately: false", () => {
    const result = createQuotationSchema.safeParse({
      title: "Test",
      items: [],
      sendImmediately: false,
    });
    expect(result.success).toBe(true);
    expect(result.data?.sendImmediately).toBe(false);
  });
});
