From 6b2e6f7bcbae67301476db23739f1f83530ca0b0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 09:38:59 +0200 Subject: [PATCH] Test happy path --- .../integrations/validators/elastic.spec.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 qa-core/src/integrations/validators/elastic.spec.ts diff --git a/qa-core/src/integrations/validators/elastic.spec.ts b/qa-core/src/integrations/validators/elastic.spec.ts new file mode 100644 index 0000000000..61e4ed00f5 --- /dev/null +++ b/qa-core/src/integrations/validators/elastic.spec.ts @@ -0,0 +1,23 @@ +import { ElasticsearchContainer } from "testcontainers" +import elastic from "../../../../packages/server/src/integrations/elasticsearch" + +jest.unmock("@elastic/elasticsearch") + +describe("datasource validators", () => { + describe("elastic search", () => { + let url: string + + beforeAll(async () => { + const container = await new ElasticsearchContainer().start() + url = container.getHttpUrl() + }) + + it("test valid connection string", async () => { + const integration = new elastic.integration({ + url, + }) + const result = await integration.testConnection() + expect(result).toEqual({ connected: true }) + }) + }) +})