fix: fixed tests

ref: N25B-450
This commit is contained in:
JGerla
2026-01-22 14:21:03 +01:00
parent 64dcdc49b3
commit e5b438c17e
3 changed files with 18 additions and 15 deletions

View File

@@ -196,17 +196,20 @@ const useFlowStore = create<FlowState>(UndoRedo((set, get) => ({
// If there's no function, OR, our function tells us we can delete it, let's do so...
if (ourFunction == undefined || ourFunction()) {
deleteElements({
nodes: get().nodes.filter((n) => n.id === nodeId),
edges: get().edges.filter((e) => e.source !== nodeId && e.target === nodeId)}
).then(() => {
get().unregisterNodeRules(nodeId);
get().unregisterWarningsForId(nodeId);
});
// set({
// nodes: get().nodes.filter((n) => n.id !== nodeId),
// edges: get().edges.filter((e) => e.source !== nodeId && e.target !== nodeId),
// })
if (deleteElements){
deleteElements({
nodes: get().nodes.filter((n) => n.id === nodeId),
edges: get().edges.filter((e) => e.source !== nodeId && e.target === nodeId)}
).then(() => {
get().unregisterNodeRules(nodeId);
get().unregisterWarningsForId(nodeId);
});
} else {
set({
nodes: get().nodes.filter((n) => n.id !== nodeId),
edges: get().edges.filter((e) => e.source !== nodeId && e.target !== nodeId),
})
}
}
},