From 6216337ed974c5b97e27d4ddb80bf18972cd463e Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Mon, 1 Apr 2024 22:25:11 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20(index.tsx):=20remove=20unused?= =?UTF-8?q?=20import=20of=20cn=20function=20from=20utils/utils=20file=20?= =?UTF-8?q?=F0=9F=90=9B=20(index.tsx):=20fix=20condition=20for=20checking?= =?UTF-8?q?=20if=20event.shiftKey=20is=20true=20in=20NodeToolbarComponent?= =?UTF-8?q?=20=F0=9F=90=9B=20(index.tsx):=20fix=20button=20data-testid=20a?= =?UTF-8?q?ttribute=20value=20for=20duplicate=20button=20in=20NodeToolbarC?= =?UTF-8?q?omponent=20=F0=9F=90=9B=20(intComponent.spec.ts):=20fix=20data-?= =?UTF-8?q?testid=20attribute=20value=20for=20model=5FspecsChatOpenAI=20el?= =?UTF-8?q?ement=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent?= =?UTF-8?q?.spec.ts):=20fix=20data-testid=20attribute=20value=20for=20titl?= =?UTF-8?q?e-ChatOpenAI=20element=20in=20IntComponent=20test=20?= =?UTF-8?q?=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unnecessary?= =?UTF-8?q?=20code=20for=20checking=20checkbox=20state=20in=20IntComponent?= =?UTF-8?q?=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unn?= =?UTF-8?q?ecessary=20code=20for=20checking=20checkbox=20state=20in=20IntC?= =?UTF-8?q?omponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remo?= =?UTF-8?q?ve=20unnecessary=20code=20for=20checking=20checkbox=20state=20i?= =?UTF-8?q?n=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts)?= =?UTF-8?q?:=20remove=20unnecessary=20code=20for=20checking=20checkbox=20s?= =?UTF-8?q?tate=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.?= =?UTF-8?q?spec.ts):=20remove=20unnecessary=20code=20for=20checking=20chec?= =?UTF-8?q?kbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intCo?= =?UTF-8?q?mponent.spec.ts):=20remove=20unnecessary=20code=20for=20checkin?= =?UTF-8?q?g=20checkbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B?= =?UTF-8?q?=20(intComponent.spec.ts):=20remove=20unnecessary=20code=20for?= =?UTF-8?q?=20checking=20checkbox=20state=20in=20IntComponent=20test=20?= =?UTF-8?q?=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unnecessary?= =?UTF-8?q?=20code=20for=20checking=20checkbox=20state=20in=20IntComponent?= =?UTF-8?q?=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unn?= =?UTF-8?q?ecessary=20code=20for=20checking=20checkbox=20state=20in=20IntC?= =?UTF-8?q?omponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remo?= =?UTF-8?q?ve=20unnecessary=20code=20for=20checking=20checkbox=20state=20i?= =?UTF-8?q?n=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts)?= =?UTF-8?q?:=20remove=20unnecessary=20code=20for=20checking=20checkbox=20s?= =?UTF-8?q?tate=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.?= =?UTF-8?q?spec.ts):=20remove=20unnecessary=20code=20for=20checking=20chec?= =?UTF-8?q?kbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intCo?= =?UTF-8?q?mponent.spec.ts):=20remove=20unnecessary=20code=20for=20checkin?= =?UTF-8?q?g=20checkbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B?= =?UTF-8?q?=20(intComponent.spec.ts):=20remove=20unnecessary=20code=20for?= =?UTF-8?q?=20checking=20checkbox=20state=20in=20IntComponent=20test=20?= =?UTF-8?q?=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unnecessary?= =?UTF-8?q?=20code=20for=20checking=20checkbox=20state=20in=20IntComponent?= =?UTF-8?q?=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unn?= =?UTF-8?q?ecessary=20code=20for=20checking=20checkbox=20state=20in=20IntC?= =?UTF-8?q?omponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remo?= =?UTF-8?q?ve=20unnecessary=20code=20for=20checking=20checkbox=20state=20i?= =?UTF-8?q?n=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts)?= =?UTF-8?q?:=20remove=20unnecessary=20code=20for=20checking=20checkbox=20s?= =?UTF-8?q?tate=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.?= =?UTF-8?q?spec.ts):=20remove=20unnecessary=20code=20for=20checking=20chec?= =?UTF-8?q?kbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intCo?= =?UTF-8?q?mponent.spec.ts):=20remove=20unnecessary=20code=20for=20checkin?= =?UTF-8?q?g=20checkbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B?= =?UTF-8?q?=20(intComponent.spec.ts):=20remove=20unnecessary=20code=20for?= =?UTF-8?q?=20checking=20checkbox=20state=20in=20IntComponent=20test=20?= =?UTF-8?q?=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unnecessary?= =?UTF-8?q?=20code=20for=20checking=20checkbox=20state=20in=20IntComponent?= =?UTF-8?q?=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unn?= =?UTF-8?q?ecessary=20code=20for=20checking=20checkbox=20state=20in=20IntC?= =?UTF-8?q?omponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remo?= =?UTF-8?q?ve=20unnecessary=20code=20for=20checking=20checkbox=20state=20i?= =?UTF-8?q?n=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts)?= =?UTF-8?q?:=20remove=20unnecessary=20code=20for=20checking=20checkbox=20s?= =?UTF-8?q?tate=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.?= =?UTF-8?q?spec.ts):=20remove=20unnecessary=20code=20for=20checking=20chec?= =?UTF-8?q?kbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intCo?= =?UTF-8?q?mponent.spec.ts):=20remove=20unnecessary=20code=20for=20checkin?= =?UTF-8?q?g=20checkbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B?= =?UTF-8?q?=20(intComponent.spec.ts):=20remove=20unnecessary=20code=20for?= =?UTF-8?q?=20checking=20checkbox=20state=20in=20IntComponent=20test=20?= =?UTF-8?q?=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unnecessary?= =?UTF-8?q?=20code=20for=20checking=20checkbox=20state=20in=20IntComponent?= =?UTF-8?q?=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unn?= =?UTF-8?q?ecessary=20code=20for=20checking=20checkbox=20state=20in=20IntC?= =?UTF-8?q?omponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remo?= =?UTF-8?q?ve=20unnecessary=20code=20for=20checking=20checkbox=20state=20i?= =?UTF-8?q?n=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts)?= =?UTF-8?q?:=20remove=20unnecessary=20code=20for=20checking=20checkbox=20s?= =?UTF-8?q?tate=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.?= =?UTF-8?q?spec.ts):=20remove=20unnecessary=20code=20for=20checking=20chec?= =?UTF-8?q?kbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intCo?= =?UTF-8?q?mponent.spec.ts):=20remove=20unnecessary=20code=20for=20checkin?= =?UTF-8?q?g=20checkbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B?= =?UTF-8?q?=20(intComponent.spec.ts):=20remove=20unnecessary=20code=20for?= =?UTF-8?q?=20checking=20checkbox=20state=20in=20IntComponent=20test=20?= =?UTF-8?q?=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unnecessary?= =?UTF-8?q?=20code=20for=20checking=20checkbox=20state=20in=20IntComponent?= =?UTF-8?q?=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remove=20unn?= =?UTF-8?q?ecessary=20code=20for=20checking=20checkbox=20state=20in=20IntC?= =?UTF-8?q?omponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts):=20remo?= =?UTF-8?q?ve=20unnecessary=20code=20for=20checking=20checkbox=20state=20i?= =?UTF-8?q?n=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.spec.ts)?= =?UTF-8?q?:=20remove=20unnecessary=20code=20for=20checking=20checkbox=20s?= =?UTF-8?q?tate=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intComponent.?= =?UTF-8?q?spec.ts):=20remove=20unnecessary=20code=20for=20checking=20chec?= =?UTF-8?q?kbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B=20(intCo?= =?UTF-8?q?mponent.spec.ts):=20remove=20unnecessary=20code=20for=20checkin?= =?UTF-8?q?g=20checkbox=20state=20in=20IntComponent=20test=20=F0=9F=90=9B?= =?UTF-8?q?=20(intComponent.spec.ts):=20remove=20unnecessary=20code=20for?= =?UTF-8?q?=20checking=20checkbox=20state=20in=20IntComponent=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/nodeToolbarComponent/index.tsx | 12 ++++---- .../tests/end-to-end/intComponent.spec.ts | 28 ++----------------- .../end-to-end/langflowShortcuts.spec.ts | 4 ++- .../end-to-end/promptModalComponent.spec.ts | 2 -- .../end-to-end/textAreaModalComponent.spec.ts | 1 + 5 files changed, 12 insertions(+), 35 deletions(-) diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 36cf93a04..76713819a 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -29,7 +29,7 @@ import { expandGroupNode, updateFlowPosition, } from "../../../../utils/reactflowUtils"; -import { classNames, cn } from "../../../../utils/utils"; +import { classNames } from "../../../../utils/utils"; import ToolbarSelectItem from "./toolbarSelectItem"; export default function NodeToolbarComponent({ @@ -326,7 +326,8 @@ export default function NodeToolbarComponent({ if ( selected && !isGroup && - (event.ctrlKey || event.metaKey) && event.shiftKey&& + (event.ctrlKey || event.metaKey) && + event.shiftKey && event.key === "A" ) { event.preventDefault(); @@ -409,15 +410,14 @@ export default function NodeToolbarComponent({ diff --git a/src/frontend/tests/end-to-end/intComponent.spec.ts b/src/frontend/tests/end-to-end/intComponent.spec.ts index f146be0d6..ae5e2fbd2 100644 --- a/src/frontend/tests/end-to-end/intComponent.spec.ts +++ b/src/frontend/tests/end-to-end/intComponent.spec.ts @@ -16,7 +16,7 @@ test("IntComponent", async ({ page }) => { await page.waitForTimeout(1000); await page - .getByTestId("modelsOpenAI") + .getByTestId("model_specsChatOpenAI") .first() .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.mouse.up(); @@ -52,7 +52,7 @@ test("IntComponent", async ({ page }) => { expect(false).toBeTruthy(); } - await page.getByTestId("title-OpenAI").click(); + await page.getByTestId("title-ChatOpenAI").click(); await page .locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]') .click(); @@ -79,11 +79,6 @@ test("IntComponent", async ({ page }) => { .getByTestId("edit-int-input-max_tokens") .fill("123456789123456789123456789"); - await page.locator('//*[@id="showinput_value"]').click(); - expect( - await page.locator('//*[@id="showinput_value"]').isChecked() - ).toBeFalsy(); - await page.locator('//*[@id="showmodel_kwargs"]').click(); expect( await page.locator('//*[@id="showmodel_kwargs"]').isChecked() @@ -104,19 +99,11 @@ test("IntComponent", async ({ page }) => { await page.locator('//*[@id="showopenai_api_key"]').isChecked() ).toBeFalsy(); - await page.locator('//*[@id="showstream"]').click(); - expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy(); - await page.locator('//*[@id="showtemperature"]').click(); expect( await page.locator('//*[@id="showtemperature"]').isChecked() ).toBeFalsy(); - await page.locator('//*[@id="showinput_value"]').click(); - expect( - await page.locator('//*[@id="showinput_value"]').isChecked() - ).toBeTruthy(); - await page.locator('//*[@id="showmodel_kwargs"]').click(); expect( await page.locator('//*[@id="showmodel_kwargs"]').isChecked() @@ -137,19 +124,11 @@ test("IntComponent", async ({ page }) => { await page.locator('//*[@id="showopenai_api_key"]').isChecked() ).toBeTruthy(); - await page.locator('//*[@id="showstream"]').click(); - expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeTruthy(); - await page.locator('//*[@id="showtemperature"]').click(); expect( await page.locator('//*[@id="showtemperature"]').isChecked() ).toBeTruthy(); - await page.locator('//*[@id="showinput_value"]').click(); - expect( - await page.locator('//*[@id="showinput_value"]').isChecked() - ).toBeFalsy(); - await page.locator('//*[@id="showmodel_kwargs"]').click(); expect( await page.locator('//*[@id="showmodel_kwargs"]').isChecked() @@ -170,9 +149,6 @@ test("IntComponent", async ({ page }) => { await page.locator('//*[@id="showopenai_api_key"]').isChecked() ).toBeFalsy(); - await page.locator('//*[@id="showstream"]').click(); - expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy(); - await page.locator('//*[@id="showtemperature"]').click(); expect( await page.locator('//*[@id="showtemperature"]').isChecked() diff --git a/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts b/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts index 3fde97938..906c5e55f 100644 --- a/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts +++ b/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts @@ -29,6 +29,8 @@ test("LangflowShortcuts", async ({ page }) => { .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.mouse.up(); await page.mouse.down(); + + await page.locator('//*[@id="react-flow-id"]/div/div[2]/button[3]').click(); await page .locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]') .click(); @@ -41,7 +43,7 @@ test("LangflowShortcuts", async ({ page }) => { .locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]') .click(); await page.getByTestId("title-Ollama").click(); - await page.keyboard.press(`${control}+e`); + await page.keyboard.press(`${control}+Shift+A`); await page.locator('//*[@id="saveChangesBtn"]').click(); await page.getByTestId("title-Ollama").click(); diff --git a/src/frontend/tests/end-to-end/promptModalComponent.spec.ts b/src/frontend/tests/end-to-end/promptModalComponent.spec.ts index e725322e0..8a64d8dcb 100644 --- a/src/frontend/tests/end-to-end/promptModalComponent.spec.ts +++ b/src/frontend/tests/end-to-end/promptModalComponent.spec.ts @@ -33,8 +33,6 @@ test("PromptTemplateComponent", async ({ page }) => { .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-template") .fill("{prompt} example {prompt1}"); diff --git a/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts b/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts index b8ca1088e..c8f69742a 100644 --- a/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts +++ b/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts @@ -7,6 +7,7 @@ test("TextAreaModalComponent", async ({ page }) => { await page.locator('//*[@id="new-project-btn"]').click(); await page.waitForTimeout(1000); + await page.locator('//*[@id="new-project-btn"]').click(); await page.getByTestId("blank-flow").click(); await page.waitForTimeout(1000); await page.getByTestId("extended-disclosure").click();