1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00
budibase/packages/builder/tests/buildStateOrigins.spec.js
Michael Shanks b7d9e05641
Work on Components API & bugfixes (#102)
* typo - screens not being sent to page save

* removed children arg from hydrateChildren (n/a)

* initialiseChildren does not rerender unless forced

* removed derivatives of initialiseChildren

* renamed initialiseChildren > attachChildren

* standard-components - refactoring

div now container
H1, h2... etc now Heading with type
Select now takes option as _children

* loads of bug fixing

* safe props creation
anytime props are loaded,
we make sure they conform to the components props definition
2020-02-14 11:51:45 +00:00

30 lines
730 B
JavaScript

import { buildStateOrigins } from "../src/builderStore/buildStateOrigins";
it("builds the correct stateOrigins object from a screen definition with handlers", () => {
expect(buildStateOrigins({
"name": "screen1",
"description": "",
"props": {
"_component": "@budibase/standard-components/container",
"className": "",
"type": "div",
"onClick": [
{
"##eventHandlerType": "Set State",
"parameters": {
"path": "testKey",
"value": "value"
}
}
]
}
})).toEqual({
"testKey": {
"##eventHandlerType": "Set State",
"parameters": {
"path": "testKey",
"value": "value"
}
}
});
});