fix: Update duckduckgo-search to 6.3.4 and improve tests (#4504)

⬆️ (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
This commit is contained in:
Cristhian Zanforlin Lousa 2024-11-11 17:34:03 -03:00 • committed by GitHub
commit 537a8010f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 24 deletions

View file

@ -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("/");
@ -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");
}
}
});