From 364ba9f90172393bb3c88086cc6eed9edfceab83 Mon Sep 17 00:00:00 2001 From: rafaelsideguide <150964962+rafaelsideguide@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:05:02 -0300 Subject: [PATCH] fix(cicd): mendable->firecrawl and waitfor --- apps/api/src/__tests__/e2e_v1_withAuth/index.test.ts | 10 +++++----- apps/api/src/__tests__/e2e_withAuth/index.test.ts | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/api/src/__tests__/e2e_v1_withAuth/index.test.ts b/apps/api/src/__tests__/e2e_v1_withAuth/index.test.ts index 2d27462f..e51b349d 100644 --- a/apps/api/src/__tests__/e2e_v1_withAuth/index.test.ts +++ b/apps/api/src/__tests__/e2e_v1_withAuth/index.test.ts @@ -390,7 +390,7 @@ describe("E2E Tests for v1 API Routes", () => { const scrapeRequest: ScrapeRequest = { url: "https://ycombinator.com/companies", formats: ["markdown"], - waitFor: 5000 + waitFor: 8000 }; const response: ScrapeResponseRequestTest = await request(TEST_URL) @@ -560,7 +560,9 @@ describe("POST /v1/map", () => { const links = response.body.links as unknown[]; expect(Array.isArray(links)).toBe(true); expect(links.length).toBeGreaterThan(0); - expect(links[0]).toContain("docs.firecrawl.dev"); + + const containsDocsFirecrawlDev = links.some((link: string) => link.includes("docs.firecrawl.dev")); + expect(containsDocsFirecrawlDev).toBe(true); }, 10000) it.concurrent("should return a successful response with a valid API key and search and not allowSubdomains and www", async () => { @@ -894,9 +896,7 @@ describe("GET /v1/crawl/:jobId", () => { expect(completedResponse.body.data[0]).not.toHaveProperty("content"); expect(completedResponse.body.data[0]).toHaveProperty("markdown"); expect(completedResponse.body.data[0]).toHaveProperty("metadata"); - expect(completedResponse.body.data[0].metadata.statusCode).toBe( - 200 - ); + expect(completedResponse.body.data[0].metadata.statusCode).toBe(200); expect( completedResponse.body.data[0].metadata.error ).toBeUndefined(); diff --git a/apps/api/src/__tests__/e2e_withAuth/index.test.ts b/apps/api/src/__tests__/e2e_withAuth/index.test.ts index 330f8130..26caf63e 100644 --- a/apps/api/src/__tests__/e2e_withAuth/index.test.ts +++ b/apps/api/src/__tests__/e2e_withAuth/index.test.ts @@ -659,7 +659,7 @@ describe("E2E Tests for v0 API Routes", () => { .post("/v0/crawl") .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`) .set("Content-Type", "application/json") - .send({ url: "https://mendable.ai/blog" }); + .send({ url: "https://firecrawl.dev/blog" }); expect(crawlResponse.statusCode).toBe(200); let isCompleted = false; @@ -689,10 +689,8 @@ describe("E2E Tests for v0 API Routes", () => { expect(completedResponse.body.data[0]).toHaveProperty("content"); expect(completedResponse.body.data[0]).toHaveProperty("markdown"); expect(completedResponse.body.data[0]).toHaveProperty("metadata"); - expect(completedResponse.body.data[0].content).toContain("Mendable"); - expect(completedResponse.body.data[0].metadata.pageStatusCode).toBe( - 200 - ); + expect(completedResponse.body.data[0].content).toContain("Firecrawl"); + expect(completedResponse.body.data[0].metadata.pageStatusCode).toBe(200); expect( completedResponse.body.data[0].metadata.pageError ).toBeUndefined(); @@ -701,7 +699,7 @@ describe("E2E Tests for v0 API Routes", () => { (doc) => doc.metadata && doc.metadata.sourceURL && - doc.metadata.sourceURL.includes("mendable.ai/blog") + doc.metadata.sourceURL.includes("firecrawl.dev/blog") ); expect(childrenLinks.length).toBe(completedResponse.body.data.length);