import { isVerticalListOrGrid } from "../utils";

describe("ZappPipesDataConnector utils", () => {
  describe("isVerticalListOrGrid", () => {
    it("should return true for list-qb components", () => {
      const component = {
        component_type: "list-qb",
      } as any;

      expect(isVerticalListOrGrid(component)).toBe(true);
    });

    it("should return true for grid-qb components", () => {
      const component = {
        component_type: "grid-qb",
      } as any;

      expect(isVerticalListOrGrid(component)).toBe(true);
    });

    it("should return false for other component types", () => {
      const component = {
        component_type: "horizontal-list",
      } as any;

      expect(isVerticalListOrGrid(component)).toBe(false);
    });

    it("should return false for undefined component", () => {
      expect(isVerticalListOrGrid(undefined)).toBe(false);
    });

    it("should return false for component without type", () => {
      const component = {} as any;

      expect(isVerticalListOrGrid(component)).toBe(false);
    });
  });
});
