Merging dev into main #49
@@ -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));
|
||||
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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",
|
||||
},],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -31,5 +31,3 @@ export function resetFlowStore() {
|
||||
});
|
||||
}
|
||||
|
||||
// Re-export everything from testing library
|
||||
export * from '@testing-library/react';
|
||||
Reference in New Issue
Block a user