Update tests to check new formats
This commit is contained in:
parent
70b809e4f7
commit
d2877fff6e
|
@ -41,7 +41,7 @@ describe("datasource validators", () => {
|
|||
collection: "",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test wrong password", async () => {
|
||||
|
@ -54,6 +54,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: "not authorized to execute this request",
|
||||
})
|
||||
})
|
||||
|
@ -68,6 +69,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: "getaddrinfo ENOTFOUND not.here",
|
||||
})
|
||||
})
|
||||
|
|
|
@ -37,7 +37,7 @@ describe("datasource validators", () => {
|
|||
database: "db",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test invalid database", async () => {
|
||||
|
@ -56,6 +56,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error:
|
||||
"request to http://invalid:123/any failed, reason: getaddrinfo ENOTFOUND invalid",
|
||||
})
|
||||
|
|
|
@ -41,7 +41,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test wrong endpoint", async () => {
|
||||
|
@ -54,6 +54,7 @@ describe("datasource validators", () => {
|
|||
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error:
|
||||
"Inaccessible host: `wrong.url' at port `undefined'. This service may not be available in the `eu-west-1' region.",
|
||||
})
|
||||
|
|
|
@ -49,7 +49,7 @@ describe("datasource validators", () => {
|
|||
tlsCAFile: "",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test invalid password", async () => {
|
||||
|
|
|
@ -43,7 +43,7 @@ describe("datasource validators", () => {
|
|||
schema: "dbo",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test invalid password", async () => {
|
||||
|
@ -57,6 +57,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: "ConnectionError: Login failed for user 'sa'.",
|
||||
})
|
||||
})
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("datasource validators", () => {
|
|||
rejectUnauthorized: true,
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test invalid database", async () => {
|
||||
|
@ -45,6 +45,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: "Access denied for user 'user'@'%' to database 'test'",
|
||||
})
|
||||
})
|
||||
|
@ -60,6 +61,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error:
|
||||
"Access denied for user 'root'@'172.17.0.1' (using password: YES)",
|
||||
})
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("datasource validators", () => {
|
|||
rejectUnauthorized: false,
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test invalid connection string", async () => {
|
||||
|
@ -46,6 +46,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error: 'password authentication failed for user "wrong"',
|
||||
})
|
||||
})
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("datasource validators", () => {
|
|||
username: "",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test invalid connection even with wrong user/password", async () => {
|
||||
|
@ -64,7 +64,7 @@ describe("datasource validators", () => {
|
|||
password: "P@ssW0rd!",
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("datasource validators", () => {
|
|||
endpoint: `http://${host}:${port}`,
|
||||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toBe(true)
|
||||
expect(result).toEqual({ connected: true })
|
||||
})
|
||||
|
||||
it("test wrong endpoint", async () => {
|
||||
|
@ -43,6 +43,7 @@ describe("datasource validators", () => {
|
|||
})
|
||||
const result = await integration.testConnection()
|
||||
expect(result).toEqual({
|
||||
connected: false,
|
||||
error:
|
||||
"Inaccessible host: `wrong' at port `undefined'. This service may not be available in the `eu-west-2' region.",
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue