@applicaster/zapp-react-native-ui-components
Version:
Applicaster Zapp React Native ui components for the Quick Brick App
40 lines (30 loc) • 1.08 kB
text/typescript
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);
});
});
});