Merging dev into main #49
@@ -17,4 +17,14 @@ describe('Drag-and-Drop sidebar', () => {
|
||||
expect(updatedState.nodes.length).toBe(1);
|
||||
expect(updatedState.nodes[0].type).toBe(nodeType);
|
||||
});
|
||||
test.each(['phase', 'norm'])('new nodes get correct Id', (nodeType) => {
|
||||
act(()=> {
|
||||
addNode(nodeType, {x:100, y:100});
|
||||
addNode(nodeType, {x:100, y:100});
|
||||
})
|
||||
const updatedState = useFlowStore.getState();
|
||||
expect(updatedState.nodes.length).toBe(2);
|
||||
expect(updatedState.nodes[0].id).toBe(`${nodeType}-0`);
|
||||
expect(updatedState.nodes[1].id).toBe(`${nodeType}-1`);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user