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

@@ -36,7 +36,7 @@ function createNode(id: string, type: string, position: XYPosition, data: Record
position,
deletable,
data: {
...defaultData,
...JSON.parse(JSON.stringify(defaultData)),
...data,
},
}

View File

@@ -141,7 +141,11 @@ export function NormConnectionSource(_thisNode: Node, _targetNodeId: string) {
* @param _sourceNodeId the source of the disconnected connection
*/
export function NormDisconnectionTarget(_thisNode: Node, _sourceNodeId: string) {
// no additional connection logic exists yet
const data = _thisNode.data as NormNodeData;
// If we got a belief connected, this is a condition for the norm.
if ((useFlowStore.getState().nodes.find((node) => node.id === _sourceNodeId && node.type === 'basic_belief' /* TODO: Add the option for an inferred belief */))) {
data.conditions = data.conditions.filter(id => id != _sourceNodeId);
}
}
/**