mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Add undo/redo creating a node in new canvas (no-changelog) (#10142)
This commit is contained in:
@@ -333,6 +333,19 @@ describe('useCanvasOperations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('revertAddNode', () => {
|
||||
it('deletes node if it exists', async () => {
|
||||
const node = createTestNode();
|
||||
vi.spyOn(workflowsStore, 'getNodeByName').mockReturnValueOnce(node);
|
||||
vi.spyOn(workflowsStore, 'getNodeById').mockReturnValueOnce(node);
|
||||
const removeNodeByIdSpy = vi.spyOn(workflowsStore, 'removeNodeById');
|
||||
|
||||
await canvasOperations.revertAddNode(node.name);
|
||||
|
||||
expect(removeNodeByIdSpy).toHaveBeenCalledWith(node.id);
|
||||
});
|
||||
});
|
||||
|
||||
describe('deleteNode', () => {
|
||||
it('should delete node and track history', () => {
|
||||
const removeNodeByIdSpy = vi
|
||||
|
||||
Reference in New Issue
Block a user