feat: fix a lot of small changes to match cb, add functionality for all plans, add tests for the new plan editor. even more i dont really know anymore.

ref: N25B-412
This commit is contained in:
Björn Otgaar
2025-12-17 15:51:50 +01:00
parent c1ef924be1
commit 444e8b0289
16 changed files with 884 additions and 561 deletions

View File

@@ -425,7 +425,6 @@ describe('NormNode', () => {
label: 'Safety Norm',
norm: 'Never harm humans',
critical: false,
basic_beliefs: [],
});
});
@@ -917,17 +916,8 @@ describe('NormNode', () => {
}
};
const mockBelief2: Node = {
id: 'basic_belief-2',
type: 'basic_belief',
position: {x:300, y:300},
data: {
...JSON.parse(JSON.stringify(BasicBeliefNodeDefaults))
}
};
useFlowStore.setState({
nodes: [mockNode, mockBelief1, mockBelief2],
nodes: [mockNode, mockBelief1],
edges: [],
});
@@ -938,16 +928,11 @@ describe('NormNode', () => {
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).toEqual(["basic_belief-1", "basic_belief-2"]);
expect(updatedNorm?.data.condition).toEqual("basic_belief-1");
});
});
});