* refactoring server for screens & page layout restructure * Disable API calls, UI placeholders. * buildPropsHierarchy is gone & screen has url * Recent changes. * router * router * updated git-ignore to reinclude server/utilities/builder * modified cli - budi new create new file structure * Fix uuid import. * prettier fixes * prettier fixes * prettier fixes * page/screen restructure.. broken tests * all tests passing at last * screen routing tests * Working screen editor and preview. * Render page previews to the screen. * Key input lists to ensure new array references when updating styles. * Ensure the iframe html and body fills the container. * Save screens via the API. * Get all save APIs almost working. * Write pages.json to disk. * Use correct API endpoint for saving styles. * Differentiate between saving properties of screens and pages. * Add required fields to default pages layouts. * Add _css default property to newly created screens. * Add default code property. * page layout / screens - app output Co-authored-by: pngwn <pnda007@gmail.com>
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import { componentDependencies } from "../src/userInterface/pagesParsing/findDependencies"
|
|
import { componentsAndScreens } from "./testData"
|
|
import { some, find } from "lodash/fp"
|
|
|
|
describe("component dependencies", () => {
|
|
const contains = (result, name) => some(c => c.name === name)(result)
|
|
|
|
const get = (all, name) => find(c => c.name === name)(all)
|
|
|
|
it("should include component that inheirts", () => {
|
|
const { components, screens } = componentsAndScreens()
|
|
|
|
const result = componentDependencies(
|
|
{},
|
|
screens,
|
|
components,
|
|
get([...components, ...screens], "budibase-components/TextBox")
|
|
)
|
|
|
|
expect(contains(result.dependantComponents, "common/SmallTextbox")).toBe(
|
|
true
|
|
)
|
|
})
|
|
|
|
it("should include components in page apbody", () => {
|
|
const { components, screens } = componentsAndScreens()
|
|
const pages = {
|
|
main: {
|
|
appBody: "PrimaryButton",
|
|
},
|
|
}
|
|
|
|
const result = componentDependencies(
|
|
pages,
|
|
screens,
|
|
components,
|
|
get([...components, ...screens], "PrimaryButton")
|
|
)
|
|
|
|
expect(result.dependantPages).toEqual(["main"])
|
|
})
|
|
})
|