Fixing test case.

This commit is contained in:
mike12345567 2022-09-02 19:59:19 +01:00
parent a5f475872d
commit 9725cb732b
1 changed files with 8 additions and 25 deletions

View File

@ -231,20 +231,6 @@ describe("/queries", () => {
url: `/api/queries/preview`, url: `/api/queries/preview`,
}) })
}) })
it("should fail with invalid integration type", async () => {
const { datasource } = await createInvalidIntegration()
await request
.post(`/api/queries/preview`)
.send({
datasourceId: datasource._id,
parameters: {},
fields: {},
queryVerb: "read",
})
.set(config.defaultHeaders())
.expect(400)
})
}) })
describe("execute", () => { describe("execute", () => {
@ -261,17 +247,14 @@ describe("/queries", () => {
}) })
it("should fail with invalid integration type", async () => { it("should fail with invalid integration type", async () => {
const { query, datasource } = await createInvalidIntegration() let error
await request try {
.post(`/api/queries/${query._id}`) await createInvalidIntegration()
.send({ } catch (err) {
datasourceId: datasource._id, error = err
parameters: {}, }
fields: {}, expect(error).toBeDefined()
queryVerb: "read", expect(error.message).toBe("No datasource implementation found.")
})
.set(config.defaultHeaders())
.expect(400)
}) })
}) })