From 1b7d80a3739b1f4b5feed9fe9acf2f6f5a381643 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Fri, 23 Feb 2024 18:05:39 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix?= =?UTF-8?q?=20key=20prop=20in=20map=20function=20to=20use=20name=20instead?= =?UTF-8?q?=20of=20index=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(?= =?UTF-8?q?parameterComponent):=20fix=20id=20prop=20in=20InputComponent=20?= =?UTF-8?q?to=20use=20name=20instead=20of=20index=20for=20better=20uniquen?= =?UTF-8?q?ess=20=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop?= =?UTF-8?q?=20in=20ToggleShadComponent=20to=20use=20name=20instead=20of=20?= =?UTF-8?q?index=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(paramete?= =?UTF-8?q?rComponent):=20fix=20id=20prop=20in=20Dropdown=20component=20to?= =?UTF-8?q?=20use=20name=20instead=20of=20index=20for=20better=20uniquenes?= =?UTF-8?q?s=20=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop?= =?UTF-8?q?=20in=20CodeInputComponent=20to=20use=20name=20instead=20of=20i?= =?UTF-8?q?ndex=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameter?= =?UTF-8?q?Component):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20?= =?UTF-8?q?name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20PromptInputComponent=20to=20use=20name=20instead=20of=20inde?= =?UTF-8?q?x=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterCom?= =?UTF-8?q?ponent):=20fix=20id=20prop=20in=20PromptInputComponent=20to=20u?= =?UTF-8?q?se=20name=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20fix=20id=20prop=20in?= =?UTF-8?q?=20CodeInputComponent=20to=20use=20name=20instead=20of=20index?= =?UTF-8?q?=20for=20better=20uniqueness=20=F0=9F=90=9B=20fix(parameterComp?= =?UTF-8?q?onent):=20fix=20id=20prop=20in=20IntComponent=20to=20use=20name?= =?UTF-8?q?=20instead=20of=20index=20for=20better=20uniqueness=20?= =?UTF-8?q?=F0=9F=90=9B=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 chore(dropdownComponent.spec.ts): comment out unused code to improve code readability and maintainability 🔧 chore(floatComponent.spec.ts): comment out unused code to improve code readability and maintainability 🔧 chore(flowPage.spec.ts): comment out unused code to improve code readability and maintainability 🔧 chore(group.spec.ts): comment out unused code to improve code readability and maintainability 🔧 chore(tests): comment out unused code in inputComponent.spec.ts, intComponent.spec.ts, keyPairListComponent.spec.ts, nestedComponent.spec.ts, saveComponents.spec.ts, and toggleComponent.spec.ts to improve code readability and reduce noise --- .../components/parameterComponent/index.tsx | 18 ++++---- .../src/modals/EditNodeModal/index.tsx | 26 ++++++++--- .../end-to-end/codeAreaModalComponent.spec.ts | 5 ++- .../end-to-end/promptModalComponent.spec.ts | 8 ++-- .../tests/onlyFront/dragAndDrop.spec.ts | 24 +++++----- .../tests/onlyFront/dropdownComponent.spec.ts | 44 +++++++++---------- .../tests/onlyFront/floatComponent.spec.ts | 20 ++++----- src/frontend/tests/onlyFront/flowPage.spec.ts | 20 ++++----- src/frontend/tests/onlyFront/group.spec.ts | 20 ++++----- .../tests/onlyFront/inputComponent.spec.ts | 20 ++++----- .../tests/onlyFront/intComponent.spec.ts | 20 ++++----- .../onlyFront/keyPairListComponent.spec.ts | 20 ++++----- .../tests/onlyFront/nestedComponent.spec.ts | 20 ++++----- .../tests/onlyFront/saveComponents.spec.ts | 20 ++++----- .../tests/onlyFront/toggleComponent.spec.ts | 20 ++++----- 15 files changed, 161 insertions(+), 144 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 79f5120c9..19f40b385 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -214,7 +214,7 @@ export default function ParameterComponent({ {item.display_name === "" ? "" : " - "} {item.display_name.split(", ").length > 2 ? item.display_name.split(", ").map((el, index) => ( - + {index === item.display_name.split(", ").length - 1 @@ -231,7 +231,7 @@ export default function ParameterComponent({ {item.type === "" ? "" : " - "} {item.type.split(", ").length > 2 ? item.type.split(", ").map((el, index) => ( - + {index === item.type.split(", ").length - 1 ? el @@ -409,7 +409,7 @@ export default function ParameterComponent({
{data.node?.template[name].refresh && ( @@ -486,7 +486,7 @@ export default function ParameterComponent({ disabled={disabled} value={data.node?.template[name].value ?? ""} onChange={handleOnNewValue} - id={"code-input-" + index} + id={"code-input-" + name} />
) : left === true && type === "file" ? ( @@ -507,7 +507,7 @@ export default function ParameterComponent({ disabled={disabled} value={data.node?.template[name].value ?? ""} onChange={handleOnNewValue} - id={"int-input-" + index} + id={"int-input-" + name} /> ) : left === true && type === "prompt" ? ( @@ -520,8 +520,8 @@ export default function ParameterComponent({ disabled={disabled} value={data.node?.template[name].value ?? ""} onChange={handleOnNewValue} - id={"prompt-input-" + index} - data-testid={"prompt-input-" + index} + id={"prompt-input-" + name} + data-testid={"prompt-input-" + name} /> ) : left === true && type === "NestedDict" ? ( diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index c89e34445..6785eea31 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -242,7 +242,11 @@ const EditNodeModal = forwardRef( /> ) : ( {" "} ) : myData.node?.template[templateParam] .type === "int" ? (
{ handleOnNewValue(value, templateParam); }} - id={"code-area-edit" + index} + id={ + "code-area-edit" + + myData.node.template[templateParam].name + } />
) : myData.node?.template[templateParam] diff --git a/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts b/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts index 66cebf6a1..1f0c2f4ac 100644 --- a/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts +++ b/src/frontend/tests/end-to-end/codeAreaModalComponent.spec.ts @@ -117,7 +117,7 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.locator('//*[@id="showcode"]').click(); expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); - await page.locator('//*[@id="code-area-edit0"]').click(); + await page.locator('//*[@id="code-area-editcode"]').click(); let value = await page.locator('//*[@id="codeValue"]').inputValue(); @@ -132,6 +132,7 @@ test("CodeAreaModalComponent", async ({ page }) => { await page.locator('//*[@id="saveChangesBtn"]').click(); - await page.locator('//*[@id="code-input-0"]').click(); + await page.getByTestId("div-generic-node").click(); + await page.getByTestId("code-button-modal").click(); } }); diff --git a/src/frontend/tests/end-to-end/promptModalComponent.spec.ts b/src/frontend/tests/end-to-end/promptModalComponent.spec.ts index 690ec2d05..f2f9e4f06 100644 --- a/src/frontend/tests/end-to-end/promptModalComponent.spec.ts +++ b/src/frontend/tests/end-to-end/promptModalComponent.spec.ts @@ -18,15 +18,17 @@ test("PromptTemplateComponent", async ({ page }) => { await page.mouse.up(); await page.mouse.down(); - await page.getByTestId("prompt-input-0").click(); + await page.getByTestId("prompt-input-template").click(); // await page.getByTestId("edit-prompt-sanitized").click(); // await page.getByTestId("modal-title").click(); await page - .getByTestId("modal-prompt-input-0") + .getByTestId("modal-prompt-input-template") .fill("{prompt} example {prompt1}"); - let value = await page.getByTestId("modal-prompt-input-0").inputValue(); + let value = await page + .getByTestId("modal-prompt-input-template") + .inputValue(); if (value != "{prompt} example {prompt1}") { expect(false).toBeTruthy(); diff --git a/src/frontend/tests/onlyFront/dragAndDrop.spec.ts b/src/frontend/tests/onlyFront/dragAndDrop.spec.ts index 09ed9b669..a8e580f61 100644 --- a/src/frontend/tests/onlyFront/dragAndDrop.spec.ts +++ b/src/frontend/tests/onlyFront/dragAndDrop.spec.ts @@ -4,16 +4,16 @@ import { readFileSync } from "fs"; test.describe("drag and drop test", () => { /// test("drop collection", async ({ page }) => { - await page.routeFromHAR("harFiles/langflow.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/langflow.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http:localhost:3000/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); // Read your file into a buffer. @@ -42,9 +42,7 @@ test.describe("drag and drop test", () => { } ); - await page - .getByTestId("edit-flow-button-e9ac1bdc-429b-475d-ac03-d26f9a2a3210-0") - .click(); + await page.getByText("Edit Flow").first().click(); await page.waitForTimeout(2000); const genericNoda = page.getByTestId("div-generic-node"); diff --git a/src/frontend/tests/onlyFront/dropdownComponent.spec.ts b/src/frontend/tests/onlyFront/dropdownComponent.spec.ts index ea397e68d..8724db6a6 100644 --- a/src/frontend/tests/onlyFront/dropdownComponent.spec.ts +++ b/src/frontend/tests/onlyFront/dropdownComponent.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; test("dropDownComponent", async ({ page }) => { - await page.routeFromHAR("harFiles/backend_12112023.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/backend_12112023.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000); @@ -30,18 +30,18 @@ test("dropDownComponent", async ({ page }) => { await page.mouse.up(); await page.mouse.down(); - await page.getByTestId("dropdown-2-display").click(); + await page.getByTestId("dropdown-model_id-display").click(); await page.getByTestId("ai21.j2-grande-instruct-0-option").click(); - let value = await page.getByTestId("dropdown-2-display").innerText(); + let value = await page.getByTestId("dropdown-model_id-display").innerText(); if (value !== "ai21.j2-grande-instruct") { expect(false).toBeTruthy(); } - await page.getByTestId("dropdown-2-display").click(); + await page.getByTestId("dropdown-model_id-display").click(); await page.getByTestId("ai21.j2-jumbo-instruct-1-option").click(); - value = await page.getByTestId("dropdown-2-display").innerText(); + value = await page.getByTestId("dropdown-model_id-display").innerText(); if (value !== "ai21.j2-jumbo-instruct") { expect(false).toBeTruthy(); } @@ -49,14 +49,14 @@ test("dropDownComponent", async ({ page }) => { await page.getByTestId("more-options-modal").click(); await page.getByTestId("edit-button-modal").click(); - value = await page.getByTestId("dropdown-edit-1-display").innerText(); + value = await page.getByTestId("dropdown-edit-model_id-display").innerText(); if (value !== "ai21.j2-jumbo-instruct") { expect(false).toBeTruthy(); } // showcode await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); + expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); @@ -64,7 +64,7 @@ test("dropDownComponent", async ({ page }) => { // showcode await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); + expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); @@ -74,7 +74,7 @@ test("dropDownComponent", async ({ page }) => { // showcode await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); + expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); @@ -82,7 +82,7 @@ test("dropDownComponent", async ({ page }) => { // showcode await page.locator('//*[@id="showcode"]').click(); - expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeTruthy(); + expect(await page.locator('//*[@id="showcode"]').isChecked()).toBeFalsy(); // showmodel_id await page.locator('//*[@id="showmodel_id"]').click(); @@ -90,17 +90,17 @@ test("dropDownComponent", async ({ page }) => { await page.locator('//*[@id="showmodel_id"]').isChecked() ).toBeTruthy(); - await page.getByTestId("dropdown-edit-1-display").click(); + await page.getByTestId("dropdown-edit-model_id-display").click(); await page.getByTestId("ai21.j2-ultra-v1-5-option").click(); - value = await page.getByTestId("dropdown-edit-1-display").innerText(); + value = await page.getByTestId("dropdown-edit-model_id-display").innerText(); if (value !== "ai21.j2-ultra-v1") { expect(false).toBeTruthy(); } await page.locator('//*[@id="saveChangesBtn"]').click(); - value = await page.getByTestId("dropdown-2-display").innerText(); + value = await page.getByTestId("dropdown-model_id-display").innerText(); if (value !== "ai21.j2-ultra-v1") { expect(false).toBeTruthy(); } diff --git a/src/frontend/tests/onlyFront/floatComponent.spec.ts b/src/frontend/tests/onlyFront/floatComponent.spec.ts index e3b55cbad..23a7b1cf8 100644 --- a/src/frontend/tests/onlyFront/floatComponent.spec.ts +++ b/src/frontend/tests/onlyFront/floatComponent.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; test("FloatComponent", async ({ page }) => { - await page.routeFromHAR("harFiles/backend_12112023.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/backend_12112023.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/onlyFront/flowPage.spec.ts b/src/frontend/tests/onlyFront/flowPage.spec.ts index 5c5d1a412..94c59d6fe 100644 --- a/src/frontend/tests/onlyFront/flowPage.spec.ts +++ b/src/frontend/tests/onlyFront/flowPage.spec.ts @@ -7,16 +7,16 @@ test.describe("Flow Page tests", () => { } test("save", async ({ page }) => { - await page.routeFromHAR("harFiles/backend_12112023.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/backend_12112023.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/onlyFront/group.spec.ts b/src/frontend/tests/onlyFront/group.spec.ts index dcd557279..d5999e8ea 100644 --- a/src/frontend/tests/onlyFront/group.spec.ts +++ b/src/frontend/tests/onlyFront/group.spec.ts @@ -4,16 +4,16 @@ import { readFileSync } from "fs"; test.describe("group node test", () => { /// test("group and ungroup updating values", async ({ page }) => { - await page.routeFromHAR("harFiles/langflow.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/langflow.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http:localhost:3000/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); // Read your file into a buffer. diff --git a/src/frontend/tests/onlyFront/inputComponent.spec.ts b/src/frontend/tests/onlyFront/inputComponent.spec.ts index 47f589059..05b1ef8d8 100644 --- a/src/frontend/tests/onlyFront/inputComponent.spec.ts +++ b/src/frontend/tests/onlyFront/inputComponent.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; test("InputComponent", async ({ page }) => { - await page.routeFromHAR("harFiles/langflow.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/langflow.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/onlyFront/intComponent.spec.ts b/src/frontend/tests/onlyFront/intComponent.spec.ts index be94d82e8..3012dc008 100644 --- a/src/frontend/tests/onlyFront/intComponent.spec.ts +++ b/src/frontend/tests/onlyFront/intComponent.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; test("IntComponent", async ({ page }) => { - await page.routeFromHAR("harFiles/backend_12112023.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/backend_12112023.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/onlyFront/keyPairListComponent.spec.ts b/src/frontend/tests/onlyFront/keyPairListComponent.spec.ts index 96530698e..2287383a5 100644 --- a/src/frontend/tests/onlyFront/keyPairListComponent.spec.ts +++ b/src/frontend/tests/onlyFront/keyPairListComponent.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; test("KeypairListComponent", async ({ page }) => { - await page.routeFromHAR("harFiles/backend_12112023.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/backend_12112023.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/onlyFront/nestedComponent.spec.ts b/src/frontend/tests/onlyFront/nestedComponent.spec.ts index 0a90533f4..0185d2139 100644 --- a/src/frontend/tests/onlyFront/nestedComponent.spec.ts +++ b/src/frontend/tests/onlyFront/nestedComponent.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; test("NestedComponent", async ({ page }) => { - await page.routeFromHAR("harFiles/backend_12112023.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/backend_12112023.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000); diff --git a/src/frontend/tests/onlyFront/saveComponents.spec.ts b/src/frontend/tests/onlyFront/saveComponents.spec.ts index 10a0c9c77..11bbbdd60 100644 --- a/src/frontend/tests/onlyFront/saveComponents.spec.ts +++ b/src/frontend/tests/onlyFront/saveComponents.spec.ts @@ -12,16 +12,16 @@ test.describe("save component tests", () => { /// test("save group component tests", async ({ page }) => { //make front work withoput backend - await page.routeFromHAR("harFiles/langflow.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/langflow.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http:localhost:3000/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); // Read your file into a buffer. diff --git a/src/frontend/tests/onlyFront/toggleComponent.spec.ts b/src/frontend/tests/onlyFront/toggleComponent.spec.ts index cdf360c57..cf83ec5e2 100644 --- a/src/frontend/tests/onlyFront/toggleComponent.spec.ts +++ b/src/frontend/tests/onlyFront/toggleComponent.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; test("ToggleComponent", async ({ page }) => { - await page.routeFromHAR("harFiles/langflow.har", { - url: "**/api/v1/**", - update: false, - }); - await page.route("**/api/v1/flows/", async (route) => { - const json = { - id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", - }; - await route.fulfill({ json, status: 201 }); - }); + // await page.routeFromHAR("harFiles/langflow.har", { + // url: "**/api/v1/**", + // update: false, + // }); + // await page.route("**/api/v1/flows/", async (route) => { + // const json = { + // id: "e9ac1bdc-429b-475d-ac03-d26f9a2a3210", + // }; + // await route.fulfill({ json, status: 201 }); + // }); await page.goto("http://localhost:3000/"); await page.waitForTimeout(2000);