test: extra norm tests

ref: N25B-392
This commit is contained in:
Björn Otgaar
2025-12-16 14:31:00 +01:00
parent 8d4c3fc64b
commit 099afebe98
4 changed files with 66 additions and 8 deletions

View File

@@ -930,14 +930,24 @@ describe('NormNode', () => {
});
// Simulate connecting
NormConnectionTarget(mockNode, mockBelief1.id);
NormConnectionTarget(mockNode, mockBelief2.id);
BasicBeliefConnectionSource(mockBelief1, mockNode.id);
BasicBeliefConnectionSource(mockBelief2, mockNode.id);
useFlowStore.getState().onConnect({
source: 'basic_belief-1',
target: 'norm-1',
sourceHandle: null,
targetHandle: null,
});
useFlowStore.getState().onConnect({
source: 'basic_belief-2',
target: 'norm-1',
sourceHandle: null,
targetHandle: null,
});
const state = useFlowStore.getState();
const updatedNorm = state.nodes.find(n => n.id === 'norm-1');
expect(updatedNorm?.data.conditions).toBe(["basic_belief-1", "basic_belief-2"]);
console.log(updatedNorm?.data.conditions);
expect(updatedNorm?.data.conditions).toEqual(["basic_belief-1", "basic_belief-1", "basic_belief-2"]);
});