From 292a891883de1e4e3164c84d110961f9f04b4e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Mon, 29 Mar 2021 17:52:38 +0200 Subject: [PATCH] update query store --- packages/builder/src/stores/backend/queries.js | 1 + packages/builder/src/stores/backend/tests/queries.spec.js | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/stores/backend/queries.js b/packages/builder/src/stores/backend/queries.js index ea016f50bc..e7980988cc 100644 --- a/packages/builder/src/stores/backend/queries.js +++ b/packages/builder/src/stores/backend/queries.js @@ -68,6 +68,7 @@ export function createQueriesStore() { return state }) + return response; }, } } diff --git a/packages/builder/src/stores/backend/tests/queries.spec.js b/packages/builder/src/stores/backend/tests/queries.spec.js index 7e5019d97c..d1efd678f9 100644 --- a/packages/builder/src/stores/backend/tests/queries.spec.js +++ b/packages/builder/src/stores/backend/tests/queries.spec.js @@ -37,15 +37,14 @@ describe("Queries Store", () => { expect(get(datasources).selected).toEqual(SOME_QUERY.datasourceId) }) - it("saves the datasource, updates the store and returns status message", async () => { + it("saves the query, updates the store and returns status message", async () => { api.post.mockReturnValue({ json: () => SAVE_QUERY_RESPONSE}) await store.select(SOME_QUERY.datasourceId, SOME_QUERY) expect(get(store).list).toEqual(expect.arrayContaining([SOME_QUERY])) }) - it("deletes a datasource, updates the store and returns status message", async () => { - console.log('After Fetch: ', get(store)) + it("deletes a query, updates the store and returns status message", async () => { api.delete.mockReturnValue({status: 200, message: `Query deleted.`})