fix: fix eslint issues, adjust norm test for dev merge

ref: N25B-371
This commit is contained in:
Björn Otgaar
2025-12-03 11:41:14 +01:00
parent f0c250626f
commit c167144b4d
6 changed files with 17 additions and 12 deletions

View File

@@ -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));

View File

@@ -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', () => {

View File

@@ -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");

View File

@@ -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",
},],
});
});
});

View File

@@ -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,

View File

@@ -31,5 +31,3 @@ export function resetFlowStore() {
});
}
// Re-export everything from testing library
export * from '@testing-library/react';