From 735c1808b22d1b1c176501c5c05d45b6b4d5e45e Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Wed, 27 Mar 2024 16:11:59 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(parameterComponent/index.tsx):=20a?= =?UTF-8?q?dd=20data-testid=20attributes=20to=20improve=20testability=20an?= =?UTF-8?q?d=20accessibility=20=E2=9C=A8=20(codeTabsComponent/index.tsx):?= =?UTF-8?q?=20add=20componentName=20prop=20to=20InputListComponent=20to=20?= =?UTF-8?q?improve=20testability=20and=20accessibility=20=E2=9C=A8=20(inpu?= =?UTF-8?q?tListComponent/index.tsx):=20add=20componentName=20prop=20to=20?= =?UTF-8?q?improve=20testability=20and=20accessibility=20=E2=9C=A8=20(text?= =?UTF-8?q?AreaComponent/index.tsx):=20add=20data-testid=20attribute=20to?= =?UTF-8?q?=20IconComponent=20to=20improve=20testability=20and=20accessibi?= =?UTF-8?q?lity=20=E2=9C=A8=20(EditNodeModal/index.tsx):=20add=20component?= =?UTF-8?q?Name=20prop=20to=20InputListComponent=20to=20improve=20testabil?= =?UTF-8?q?ity=20and=20accessibility=20=E2=9C=A8=20(DisclosureComponent/in?= =?UTF-8?q?dex.tsx):=20add=20data-testid=20attribute=20to=20Disclosure.But?= =?UTF-8?q?ton=20to=20improve=20testability=20and=20accessibility=20?= =?UTF-8?q?=E2=9C=A8=20(components/index.ts):=20add=20componentName=20prop?= =?UTF-8?q?=20to=20InputListComponentType=20to=20improve=20testability=20a?= =?UTF-8?q?nd=20accessibility=20=E2=9C=A8=20(codeAreaModalComponent.spec.t?= =?UTF-8?q?s):=20reduce=20wait=20time=20for=20better=20test=20performance?= =?UTF-8?q?=20=E2=9C=A8=20(dragAndDrop.spec.ts):=20reduce=20wait=20time=20?= =?UTF-8?q?for=20better=20test=20performance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ (dropdownComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (dropdownComponent.spec.ts): add new test file filterEdge.spec.ts to test filtering functionality in dropdown component ✅ (filterEdge.spec.ts): add tests for tooltip and filter functionality in dropdown component ✅ (floatComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✅ (flowPage.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✅ (group.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✅ (inputComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (inputListComponent.spec.ts): add end-to-end test for InputListComponent to ensure proper functionality ✨ (intComponent.spec.ts): add end-to-end test for IntComponent to ensure proper functionality ✨ (keyPairListComponent.spec.ts): add end-to-end test for KeyPairListComponent to ensure proper functionality ✨ (nestedComponent.spec.ts): add end-to-end test for NestedComponent to ensure proper functionality ✨ (promptModalComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (promptModalComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (promptModalComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (promptModalComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (saveComponents.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (saveComponents.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (saveComponents.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (saveComponents.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (textAreaModalComponent.spec.ts): add test for TextAreaModalComponent ✨ (toggleComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (toggleComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (toggleComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance ✨ (toggleComponent.spec.ts): reduce wait time for page.waitForTimeout from 2000ms to 1000ms to improve test performance --- .../components/parameterComponent/index.tsx | 33 ++- .../components/codeTabsComponent/index.tsx | 8 + .../components/inputListComponent/index.tsx | 15 ++ .../components/textAreaComponent/index.tsx | 3 +- .../src/modals/EditNodeModal/index.tsx | 6 + .../components/DisclosureComponent/index.tsx | 5 +- src/frontend/src/types/components/index.ts | 1 + .../end-to-end/codeAreaModalComponent.spec.ts | 10 +- .../tests/end-to-end/dragAndDrop.spec.ts | 2 +- .../end-to-end/dropdownComponent.spec.ts | 8 +- .../tests/end-to-end/filterEdge.spec.ts | 229 ++++++++++++++++++ .../tests/end-to-end/floatComponent.spec.ts | 8 +- .../tests/end-to-end/flowPage.spec.ts | 8 +- src/frontend/tests/end-to-end/group.spec.ts | 4 +- .../tests/end-to-end/inputComponent.spec.ts | 8 +- .../end-to-end/inputListComponent.spec.ts | 182 ++++++++++++++ .../tests/end-to-end/intComponent.spec.ts | 8 +- .../end-to-end/keyPairListComponent.spec.ts | 8 +- .../tests/end-to-end/nestedComponent.spec.ts | 8 +- .../end-to-end/promptModalComponent.spec.ts | 11 +- .../tests/end-to-end/saveComponents.spec.ts | 10 +- .../end-to-end/textAreaModalComponent.spec.ts | 66 +++++ .../tests/end-to-end/toggleComponent.spec.ts | 8 +- 23 files changed, 592 insertions(+), 57 deletions(-) create mode 100644 src/frontend/tests/end-to-end/filterEdge.spec.ts create mode 100644 src/frontend/tests/end-to-end/inputListComponent.spec.ts create mode 100644 src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 15ab94c16..67747a799 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -245,7 +245,12 @@ export default function ParameterComponent({ nodeIconsLucide[item.family] ?? nodeIconsLucide["unknown"]; return ( -
+
{index === 0 && ( {left ? INPUT_HANDLER_HOVER : OUTPUT_HANDLER_HOVER} )} @@ -269,10 +274,16 @@ export default function ParameterComponent({ }} />
- + {nodeNames[item.family] ?? "Other"}{" "} {item?.display_name && item?.display_name?.length > 0 ? ( - + {" "} {item.display_name === "" ? "" : " - "} {item.display_name.split(", ").length > 2 @@ -289,7 +300,10 @@ export default function ParameterComponent({ : item.display_name} ) : ( - + {" "} {item.type === "" ? "" : " - "} {item.type.split(", ").length > 2 @@ -312,7 +326,9 @@ export default function ParameterComponent({ }); } else { //@ts-ignore - refHtml.current = {TOOLTIP_EMPTY}; + refHtml.current = ( + {TOOLTIP_EMPTY} + ); } } // If optionalHandle is an empty list, then it is not an optional handle @@ -336,6 +352,9 @@ export default function ParameterComponent({ side={left ? "left" : "right"} >
) : node.data.node.template[ diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index b82d37f63..b43c6df86 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -11,6 +11,7 @@ export default function InputListComponent({ onChange, disabled, editNode = false, + componentName, }: InputListComponentType): JSX.Element { useEffect(() => { if (disabled && value.length > 0 && value[0] !== "") { @@ -46,6 +47,10 @@ export default function InputListComponent({ newInputList[idx] = event.target.value; onChange(newInputList); }} + data-testid={ + `input-list-input${editNode ? "-edit" : ""}_${componentName}-` + + idx + } /> {idx === value.length - 1 ? (