import { describe, expect, it } from "vitest";

import { isCheckedFormValue } from "@/lib/form-data";

describe("isCheckedFormValue", () => {
  it("treats standard checkbox values as checked", () => {
    expect(isCheckedFormValue("on")).toBe(true);
    expect(isCheckedFormValue("true")).toBe(true);
    expect(isCheckedFormValue("1")).toBe(true);
  });

  it("treats other values as unchecked", () => {
    expect(isCheckedFormValue("off")).toBe(false);
    expect(isCheckedFormValue("false")).toBe(false);
    expect(isCheckedFormValue("0")).toBe(false);
    expect(isCheckedFormValue("")).toBe(false);
    expect(isCheckedFormValue(null)).toBe(false);
    expect(isCheckedFormValue("yes")).toBe(false);
  });
});
