1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Test bad connections

This commit is contained in:
Adria Navarro 2023-05-12 11:23:51 +02:00
parent 901bff5399
commit b8d11fa351

View file

@ -44,5 +44,31 @@ describe("datasource validators", () => {
})
expect(result).toBe(true)
})
it("test wrong password", async () => {
const result = await validator({
url: connectionSettings.url,
username: connectionSettings.user,
password: "wrong",
databaseName: "",
collection: "",
})
expect(result).toEqual({
error: "not authorized to execute this request",
})
})
it("test wrong url", async () => {
const result = await validator({
url: "http://not.here",
username: connectionSettings.user,
password: connectionSettings.password,
databaseName: "",
collection: "",
})
expect(result).toEqual({
error: "getaddrinfo ENOTFOUND not.here",
})
})
})
})