Fixing test case.
This commit is contained in:
parent
a5f475872d
commit
9725cb732b
|
@ -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)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue