moving test from server
This commit is contained in:
parent
695781c149
commit
78b04ea58e
|
@ -467,11 +467,11 @@ const _saveScreen = async (store, s, screen) => {
|
|||
await api
|
||||
.post(`/_builder/api/${s.appname}/pages/${s.currentPageName}/screen`, screen)
|
||||
.then(async savedScreen => {
|
||||
_savePage(s);
|
||||
const updatedScreen = await savedScreen.json();
|
||||
const screens = [...currentPageScreens.filter(storeScreen => storeScreen.name !== updatedScreen.name), updatedScreen];
|
||||
s.pages[s.currentPageName]._screens = screens
|
||||
s.screens = screens
|
||||
_savePage(s);
|
||||
});
|
||||
|
||||
return s
|
||||
|
|
|
@ -217,36 +217,4 @@ it("/savePage should prepare all necessary client files", async () => {
|
|||
)
|
||||
expect(savedScreen2Css).toEqual(screen2Css)
|
||||
expect(indexHtmlMain.includes(screen2CssPaths.url)).toBe(true)
|
||||
})
|
||||
|
||||
it("builds the correct stateOrigins object from a screen definition with no handlers", () => {
|
||||
expect(listScreens.buildStateOrigins(screen1)).toEqual({});
|
||||
});
|
||||
|
||||
it("builds the correct stateOrigins object from a screen definition with handlers", () => {
|
||||
expect(listScreens.buildStateOrigins({
|
||||
"name": "screen1",
|
||||
"description": "",
|
||||
"props": {
|
||||
"_component": "@budibase/standard-components/div",
|
||||
"className": "",
|
||||
"onClick": [
|
||||
{
|
||||
"##eventHandlerType": "Set State",
|
||||
"parameters": {
|
||||
"path": "testKey",
|
||||
"value": "value"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})).toEqual({
|
||||
"testKey": {
|
||||
"##eventHandlerType": "Set State",
|
||||
"parameters": {
|
||||
"path": "testKey",
|
||||
"value": "value"
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
Loading…
Reference in New Issue