fix last query test

This commit is contained in:
Keviin Åberg Kultalahti 2021-03-29 17:50:12 +02:00
parent 003c1c75d4
commit e1034ae5ac
2 changed files with 4 additions and 7 deletions

View File

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

View File

@ -45,11 +45,9 @@ describe("Queries Store", () => {
expect(get(store).list).toEqual(expect.arrayContaining([SOME_QUERY])) expect(get(store).list).toEqual(expect.arrayContaining([SOME_QUERY]))
}) })
it("deletes a datasource, updates the store and returns status message", async () => { it("deletes a datasource, updates the store and returns status message", async () => {
api.get.mockReturnValue({ json: () => SOME_QUERY}) console.log('After Fetch: ', get(store))
await store.fetch() api.delete.mockReturnValue({status: 200, message: `Query deleted.`})
api.delete.mockReturnValue({status: 200, message: 'Datasource deleted.'})
await store.delete(SOME_QUERY) await store.delete(SOME_QUERY)
expect(get(store)).toEqual({ list: [], selected: null}) expect(get(store)).toEqual({ list: [], selected: null})