Skip to content

Commit

Permalink
fix: Update duckduckgo-search to 6.3.4 and improve tests (#4504)
Browse files Browse the repository at this point in the history
⬆️ (pyproject.toml): update duckduckgo-search dependency to version 6.3.4
🔧 (duckduckgo.spec.ts): remove test.skip from the test case to enable the test for duckduckgo search component
💡 (duckduckgo.spec.ts): refactor test case to improve readability and remove unnecessary code blocks
  • Loading branch information
Cristhianzl authored Nov 11, 2024
1 parent 29e4844 commit 537a801
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ dependencies = [
"jq>=1.8.0",
"pydantic-settings==2.4.0",
"ragstack-ai-knowledge-store>=0.2.1",
"duckduckgo-search>=6.3.0",
"duckduckgo-search>=6.3.4",
"opensearch-py>=2.7.1",
"langchain-google-genai>=1.0.8",
"langchain-cohere>=0.1.5",
Expand Down
17 changes: 7 additions & 10 deletions src/frontend/tests/extended/integrations/duckduckgo.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from "@playwright/test";

test.skip("user should be able to use duckduckgo search component", async ({
test("user should be able to use duckduckgo search component", async ({
page,
}) => {
await page.goto("/");
Expand Down Expand Up @@ -60,22 +60,19 @@ test.skip("user should be able to use duckduckgo search component", async ({
"built successfully",
) ?? false;

const isRateLimit =
(await page.evaluate((el) => el.textContent, result))?.includes(
"ratelimit",
) ?? false;
await page.waitForTimeout(500);
await page.getByTestId("output-inspection-data").first().click();
await page.waitForTimeout(1000);

if (isBuiltSuccessfully) {
await page.waitForTimeout(1000);
await page.getByTestId("output-inspection-data").first().click();
await page.getByRole("gridcell").first().click();
const searchResults = await page.getByPlaceholder("Empty").inputValue();
expect(searchResults.length).toBeGreaterThan(10);
expect(searchResults.toLowerCase()).toContain("langflow");
} else if (isRateLimit) {
expect(true).toBeTruthy();
} else {
expect(true).toBeFalsy();
const value = await page.getByPlaceholder("Empty").inputValue();
expect(value.length).toBeGreaterThan(10);
expect(value.toLowerCase()).toContain("ratelimit");
}
}
});
26 changes: 13 additions & 13 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 537a801

Please sign in to comment.