From aa2c14861421769df90b3ebfdce57d5b41bfa793 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Mon, 1 Apr 2024 22:56:50 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(GenericNode/index.tsx):=20add=20un?= =?UTF-8?q?ique=20id=20to=20input=20element=20for=20accessibility=20and=20?= =?UTF-8?q?testing=20purposes=20=F0=9F=90=9B=20(input.tsx):=20add=20missin?= =?UTF-8?q?g=20data-testid=20attribute=20to=20input=20element=20?= =?UTF-8?q?=F0=9F=90=9B=20(group.spec.ts):=20fix=20test=20case=20to=20corr?= =?UTF-8?q?ectly=20group=20and=20ungroup=20nodes,=20update=20selectors=20t?= =?UTF-8?q?o=20match=20changes=20in=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/CustomNodes/GenericNode/index.tsx | 1 + src/frontend/src/components/ui/input.tsx | 1 + src/frontend/tests/end-to-end/group.spec.ts | 34 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index acff11c03..29673fdb8 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -444,6 +444,7 @@ export default function GenericNode({ onChange={setNodeName} password={false} blurOnEnter={true} + id={`input-title-${data.node?.display_name}`} /> ) : ( diff --git a/src/frontend/src/components/ui/input.tsx b/src/frontend/src/components/ui/input.tsx index fa588595e..ed0e22993 100644 --- a/src/frontend/src/components/ui/input.tsx +++ b/src/frontend/src/components/ui/input.tsx @@ -8,6 +8,7 @@ const Input = React.forwardRef( ({ className, type, ...props }, ref) => { return ( { /// test("group and ungroup updating values", async ({ page }) => { - await page.goto("http:localhost:3000/"); + await page.goto("/"); await page.locator('//*[@id="new-project-btn"]').click(); - await page.getByRole("heading", { name: "Data Ingestion" }).click(); + await page + .getByRole("heading", { name: "Basic Prompting" }) + .first() + .click(); await page.waitForTimeout(2000); - await page.getByLabel("fit view").click(); - await page.keyboard.down("Control"); - await page - .getByTestId("title-OpenAIEmbeddings") - .click({ modifiers: ["Control"] }); - await page.getByTestId("title-URL").click({ modifiers: ["Control"] }); - await page - .getByTestId("title-Recursive Character Text Splitter") - .click({ modifiers: ["Control"] }); - await page.keyboard.up("Control"); + await page.getByLabel("fit view").first().click(); + await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] }); + await page.getByTestId("title-Prompt").click({ modifiers: ["Control"] }); + await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] }); + await page.getByRole("button", { name: "Group" }).click(); - await page.getByTestId(/input-collection_name_Chroma-.*/).click(); - await page.getByTestId(/input-collection_name_Chroma-.*/).fill("test"); - await page.getByTestId("title-Group").click(); + await page.getByTestId("title-Group").dblclick(); + await page.getByTestId("input-title-Group").first().fill("test"); + await page.getByTestId("icon-Ungroup").first().click(); await page.keyboard.press("Control+g"); - const value = await page.getByTestId("input-collection_name").inputValue(); - expect(value).toBe("test"); + await page.getByTestId("title-OpenAI").isVisible(); + await page.getByTestId("title-Prompt").isVisible(); }); });