diff --git a/packages/editor-ui/src/composables/useCanvasOperations.test.ts b/packages/editor-ui/src/composables/useCanvasOperations.test.ts index 1d20a020e0..f0a0b11a8f 100644 --- a/packages/editor-ui/src/composables/useCanvasOperations.test.ts +++ b/packages/editor-ui/src/composables/useCanvasOperations.test.ts @@ -995,6 +995,18 @@ describe('useCanvasOperations', () => { expect(ndvStore.activeNodeName).toBe('Existing Node'); }); + + it('should set node as dirty when node is set active', () => { + const workflowsStore = mockedStore(useWorkflowsStore); + const node = createTestNode(); + + workflowsStore.getNodeById.mockImplementation(() => node); + + const { setNodeActive } = useCanvasOperations({ router }); + setNodeActive(node.id); + + expect(workflowsStore.setNodePristine).toHaveBeenCalledWith(node.name, false); + }); }); describe('setNodeActiveByName', () => { diff --git a/packages/editor-ui/src/composables/useCanvasOperations.ts b/packages/editor-ui/src/composables/useCanvasOperations.ts index 46cfc540b8..812f453c57 100644 --- a/packages/editor-ui/src/composables/useCanvasOperations.ts +++ b/packages/editor-ui/src/composables/useCanvasOperations.ts @@ -381,6 +381,7 @@ export function useCanvasOperations({ router }: { router: ReturnType