From 1c7550e211e74b416b458d0b9917f8463c8f8b7a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 12 Feb 2020 15:47:35 +0000 Subject: [PATCH] moving test from server --- packages/builder/src/builderStore/store.js | 2 +- packages/server/tests/builder.spec.js | 34 +--------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/packages/builder/src/builderStore/store.js b/packages/builder/src/builderStore/store.js index 4871396ea0..17e850cd93 100644 --- a/packages/builder/src/builderStore/store.js +++ b/packages/builder/src/builderStore/store.js @@ -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 diff --git a/packages/server/tests/builder.spec.js b/packages/server/tests/builder.spec.js index 97ace40a72..89102146df 100644 --- a/packages/server/tests/builder.spec.js +++ b/packages/server/tests/builder.spec.js @@ -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" - } - } - }); -}); +}) \ No newline at end of file