diff --git a/src/pages/VisProgPage/visualProgrammingUI/nodes/PhaseNode.tsx b/src/pages/VisProgPage/visualProgrammingUI/nodes/PhaseNode.tsx index 06cb1e5..56c762c 100644 --- a/src/pages/VisProgPage/visualProgrammingUI/nodes/PhaseNode.tsx +++ b/src/pages/VisProgPage/visualProgrammingUI/nodes/PhaseNode.tsx @@ -79,7 +79,7 @@ export function PhaseReduce(node: Node, nodes: Node[]) { .map(([t]) => t); // children nodes - make sure to check for empty arrays - let childrenNodes: any[] = []; + let childrenNodes: Node[] = []; if (data.children) childrenNodes = nodes.filter((node) => data.children.includes(node.id)); diff --git a/test/pages/visProgPage/visualProgrammingUI/nodes/NormNode.test.tsx b/test/pages/visProgPage/visualProgrammingUI/nodes/NormNode.test.tsx index 9e3d049..598d687 100644 --- a/test/pages/visProgPage/visualProgrammingUI/nodes/NormNode.test.tsx +++ b/test/pages/visProgPage/visualProgrammingUI/nodes/NormNode.test.tsx @@ -115,8 +115,8 @@ describe('NormNode', () => { /> ); - let norm = screen.getByText("Norm :") - expect(norm).toBeInTheDocument; + const norm = screen.getByText("Norm :") + expect(norm).toBeInTheDocument(); }); it('should render with dragging state', () => { diff --git a/test/pages/visProgPage/visualProgrammingUI/nodes/PhaseNode.test.tsx b/test/pages/visProgPage/visualProgrammingUI/nodes/PhaseNode.test.tsx index 43763d3..006380c 100644 --- a/test/pages/visProgPage/visualProgrammingUI/nodes/PhaseNode.test.tsx +++ b/test/pages/visProgPage/visualProgrammingUI/nodes/PhaseNode.test.tsx @@ -22,8 +22,8 @@ describe('PhaseNode', () => { expect(p1.data.children).toEqual(p2.data.children); // Add nodes to children - let p1_data = p1.data as PhaseNodeData; - let p2_data = p2.data as PhaseNodeData; + const p1_data = p1.data as PhaseNodeData; + const p2_data = p2.data as PhaseNodeData; p1_data.children.push("norm-1"); p2_data.children.push("norm-2"); p2_data.children.push("goal-1"); diff --git a/test/pages/visProgPage/visualProgrammingUI/nodes/TriggerNode.test.tsx b/test/pages/visProgPage/visualProgrammingUI/nodes/TriggerNode.test.tsx index a7c5437..9b1ff49 100644 --- a/test/pages/visProgPage/visualProgrammingUI/nodes/TriggerNode.test.tsx +++ b/test/pages/visProgPage/visualProgrammingUI/nodes/TriggerNode.test.tsx @@ -197,8 +197,14 @@ describe('TriggerNode', () => { const result = TriggerReduce(triggerNode, allNodes); expect(result).toEqual({ - label: 'Keyword Trigger', - list: [{ id: 'kw1', keyword: 'hello' }], + id: "trigger-1", + type: "keywords", + label: 'Keyword Trigger', + keywords: [ + { + "id": "kw1", + "keyword": "hello", + },], }); }); }); diff --git a/test/pages/visProgPage/visualProgrammingUI/nodes/UniversalNodes.test.tsx b/test/pages/visProgPage/visualProgrammingUI/nodes/UniversalNodes.test.tsx index 182ff53..80e52b4 100644 --- a/test/pages/visProgPage/visualProgrammingUI/nodes/UniversalNodes.test.tsx +++ b/test/pages/visProgPage/visualProgrammingUI/nodes/UniversalNodes.test.tsx @@ -48,9 +48,10 @@ describe('NormNode', () => { test.each(getAllTypes())('it should render %s node with the default data', (nodeType) => { const lengthBefore = screen.getAllByText(/.*/).length; - let newNode = createNode(nodeType + "1", nodeType, {x: 200, y:200}, {}) - let uiElement = Object.entries(NodeTypes).find(([t])=>t==nodeType)?.[1]!; - let props = { + const newNode = createNode(nodeType + "1", nodeType, {x: 200, y:200}, {}) + const uiElement = Object.entries(NodeTypes).find(([t])=>t==nodeType)?.[1]; + expect(uiElement).toBeDefined(); + const props = { id:newNode.id, type:newNode.type as string, data:newNode.data as any, diff --git a/test/test-utils/test-utils.tsx b/test/test-utils/test-utils.tsx index 76878b9..1ad371a 100644 --- a/test/test-utils/test-utils.tsx +++ b/test/test-utils/test-utils.tsx @@ -31,5 +31,3 @@ export function resetFlowStore() { }); } -// Re-export everything from testing library -export * from '@testing-library/react'; \ No newline at end of file