diff --git a/frontend/src/framework/components/ParameterListFilter/private-utils/smartNodeSelectorUtils.ts b/frontend/src/framework/components/ParameterListFilter/private-utils/smartNodeSelectorUtils.ts index 5dc549aba..a91bccf5a 100644 --- a/frontend/src/framework/components/ParameterListFilter/private-utils/smartNodeSelectorUtils.ts +++ b/frontend/src/framework/components/ParameterListFilter/private-utils/smartNodeSelectorUtils.ts @@ -18,15 +18,6 @@ export function createAndAddNode(treeNodeDataList: TreeDataNode[], nodeName: str return newNode; } -export function findOrCreateNode(treeNodeDataList: TreeDataNode[], nodeName: string, icon?: string): TreeDataNode { - const existingNode = treeNodeDataList.find((node) => node.name === nodeName); - if (existingNode) { - return existingNode; - } - - return createAndAddNode(treeNodeDataList, nodeName, icon); -} - export function createTreeDataNodeListFromParameters( parameters: Parameter[], checkIcon?: string, @@ -50,7 +41,7 @@ export function createTreeDataNodeListFromParameters( createAndAddNode(treeDataNodeList, ParameterParentNodeNames.IS_LINEAR, checkIcon); } - // Add name parameters and check for group name + // Add parameter name and check for group name const parameterNameSet = new Set(); const groupNameSet = new Set(); for (const parameter of parameters) { diff --git a/frontend/tests/unit-tests/ParameterListFilterUtils.test.ts b/frontend/tests/unit-tests/ParameterListFilterUtils.test.ts index f255c110a..fee685d34 100644 --- a/frontend/tests/unit-tests/ParameterListFilterUtils.test.ts +++ b/frontend/tests/unit-tests/ParameterListFilterUtils.test.ts @@ -2,7 +2,6 @@ import { ContinuousParameter, DiscreteParameter, ParameterType } from "@framewor import { createAndAddNode, createTreeDataNodeListFromParameters, - findOrCreateNode, getChildNodeNamesFromParentNodeName, getParametersMatchingSelectedNodes, } from "@framework/components/ParameterListFilter/private-utils/smartNodeSelectorUtils"; @@ -48,21 +47,6 @@ describe("Test of utility functions for ParameterListFilter", () => { expect(newNode.name).toBe(myTestList[0].name); }); - test("Test find node", () => { - const testNode = { name: "my node", description: "", icon: undefined }; - const testNodes: TreeDataNode[] = [testNode]; - const foundNode = findOrCreateNode(testNodes, "my node"); - expect(foundNode.name).toBe("my node"); - expect(testNodes.length).toBe(1); - }); - - test("Test create node", () => { - const testNodes: TreeDataNode[] = []; - const createdNode = findOrCreateNode(testNodes, "my node"); - expect(createdNode.name).toBe("my node"); - expect(testNodes.length).toBe(1); - }); - test("Create tree data node list from parameters", () => { const parameterList = [CONTINUOUS_PARAMETER, DISCRETE_PARAMETER]; const testNodes = createTreeDataNodeListFromParameters(parameterList);