import { filterUndefinedProps } from "./filterUndefinedProps";

describe("filterUndefinedProps", () => {
  it("should filter out undefined props", () => {
    const props = {
      a: 1,
      b: undefined,
      c: 3,
    };

    const result = filterUndefinedProps(props);

    expect(result).toEqual({ a: 1, c: 3 });
  });

  it("preserves null and empty string (undefined-only contract)", () => {
    const result = filterUndefinedProps({
      a: 1,
      b: null,
      c: "",
      d: 0,
    });

    expect(result).toEqual({ a: 1, b: null, c: "", d: 0 });
  });
});
