fix last query test
This commit is contained in:
parent
003c1c75d4
commit
e1034ae5ac
|
@ -68,7 +68,6 @@ export function createQueriesStore() {
|
||||||
|
|
||||||
return state
|
return state
|
||||||
})
|
})
|
||||||
console.log(response)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,12 +45,10 @@ 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})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue