From e1034ae5ac5be33323b35665c8b594e07ae85362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Mon, 29 Mar 2021 17:50:12 +0200 Subject: [PATCH] fix last query test --- packages/builder/src/stores/backend/queries.js | 1 - .../builder/src/stores/backend/tests/queries.spec.js | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/stores/backend/queries.js b/packages/builder/src/stores/backend/queries.js index a23cc4d644..ea016f50bc 100644 --- a/packages/builder/src/stores/backend/queries.js +++ b/packages/builder/src/stores/backend/queries.js @@ -68,7 +68,6 @@ export function createQueriesStore() { return state }) - console.log(response) }, } } diff --git a/packages/builder/src/stores/backend/tests/queries.spec.js b/packages/builder/src/stores/backend/tests/queries.spec.js index c9d4a51c73..7e5019d97c 100644 --- a/packages/builder/src/stores/backend/tests/queries.spec.js +++ b/packages/builder/src/stores/backend/tests/queries.spec.js @@ -45,12 +45,10 @@ describe("Queries Store", () => { expect(get(store).list).toEqual(expect.arrayContaining([SOME_QUERY])) }) it("deletes a datasource, updates the store and returns status message", async () => { - api.get.mockReturnValue({ json: () => SOME_QUERY}) - - await store.fetch() - - api.delete.mockReturnValue({status: 200, message: 'Datasource deleted.'}) - + console.log('After Fetch: ', get(store)) + + api.delete.mockReturnValue({status: 200, message: `Query deleted.`}) + await store.delete(SOME_QUERY) expect(get(store)).toEqual({ list: [], selected: null}) })