Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
927 B

import { componentsAndScreens } from "./testData";
import {
find
} from "lodash/fp";
import { buildPropsHierarchy } from "../src/userInterface/pagesParsing/buildPropsHierarchy";
describe("buildPropsHierarchy", () => {
it("should build a complex component children", () => {
const {components, screens} = componentsAndScreens();
const allprops = buildPropsHierarchy(
components, screens, "ButtonGroup");
expect(allprops._component).toEqual("budibase-components/div");
const primaryButtonProps = () => ({
_component: "budibase-components/Button"
});
const button1 = primaryButtonProps();
button1.contentText = "Button 1";
expect(allprops._children[0]).toEqual(button1);
const button2 = primaryButtonProps();
button2.contentText = "Button 2";
expect(allprops._children[1]).toEqual(button2)
});
});