Browse Source

update query store

gh-pages
Keviin Åberg Kultalahti 6 years ago
parent
commit
996e4bf9b1
  1. 1
      packages/builder/src/stores/backend/queries.js
  2. 5
      packages/builder/src/stores/backend/tests/queries.spec.js

1
packages/builder/src/stores/backend/queries.js

@ -68,6 +68,7 @@ export function createQueriesStore() {
return state
})
return response;
},
}
}

5
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.`})

Loading…
Cancel
Save