Fix tests asserts
This commit is contained in:
parent
d2877fff6e
commit
ed8550b271
|
@ -1,7 +1,7 @@
|
|||
import { GenericContainer } from "testcontainers"
|
||||
import { generator } from "@budibase/backend-core/tests"
|
||||
|
||||
import couchdb from "../../../../packages/server/src/integrations/couchdb"
|
||||
import { generator } from "../../shared"
|
||||
|
||||
describe("datasource validators", () => {
|
||||
describe("couchdb", () => {
|
||||
|
@ -46,7 +46,9 @@ describe("datasource validators", () => {
|
|||
database: "random_db",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(false)
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
})
|
||||
})
|
||||
|
||||
it("test invalid url", async () => {
|
||||
|
|
|
@ -61,7 +61,10 @@ describe("datasource validators", () => {
|
|||
tlsCAFile: "",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({ error: "Authentication failed." })
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: "Authentication failed.",
|
||||
})
|
||||
})
|
||||
|
||||
it("test invalid username", async () => {
|
||||
|
@ -73,7 +76,10 @@ describe("datasource validators", () => {
|
|||
tlsCAFile: "",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({ error: "Authentication failed." })
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: "Authentication failed.",
|
||||
})
|
||||
})
|
||||
|
||||
it("test invalid connection", async () => {
|
||||
|
@ -85,7 +91,10 @@ describe("datasource validators", () => {
|
|||
tlsCAFile: "",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({ error: "Error: getaddrinfo ENOTFOUND http" })
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: "Error: getaddrinfo ENOTFOUND http",
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -36,6 +36,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error:
|
||||
"WRONGPASS invalid username-password pair or user is disabled.",
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue