diff --git a/cypress/e2e/7-workflow-actions.cy.ts b/cypress/e2e/7-workflow-actions.cy.ts index 8571b174d9..f0f3ae019a 100644 --- a/cypress/e2e/7-workflow-actions.cy.ts +++ b/cypress/e2e/7-workflow-actions.cy.ts @@ -171,9 +171,16 @@ describe('Workflow Actions', () => { cy.get('#node-creator').should('not.exist'); WorkflowPage.actions.hitSelectAll(); - cy.get('.jtk-drag-selected').should('have.length', 2); WorkflowPage.actions.hitCopy(); successToast().should('exist'); + // Both nodes should be copied + cy.window() + .its('navigator.clipboard') + .then((clip) => clip.readText()) + .then((text) => { + const copiedWorkflow = JSON.parse(text); + expect(copiedWorkflow.nodes).to.have.length(2); + }); }); it('should paste nodes (both current and old node versions)', () => { @@ -345,7 +352,15 @@ describe('Workflow Actions', () => { WorkflowPage.actions.hitDeleteAllNodes(); WorkflowPage.getters.canvasNodes().should('have.length', 0); // Button should be disabled - WorkflowPage.getters.executeWorkflowButton().should('be.disabled'); + cy.ifCanvasVersion( + () => { + WorkflowPage.getters.executeWorkflowButton().should('be.disabled'); + }, + () => { + // In new canvas, button does not exist when there are no nodes + WorkflowPage.getters.executeWorkflowButton().should('not.exist'); + }, + ); // Keyboard shortcut should not work WorkflowPage.actions.hitExecuteWorkflow(); successToast().should('not.exist'); diff --git a/packages/editor-ui/src/views/NodeView.v2.vue b/packages/editor-ui/src/views/NodeView.v2.vue index ee3fc857c1..fda3f17e6f 100644 --- a/packages/editor-ui/src/views/NodeView.v2.vue +++ b/packages/editor-ui/src/views/NodeView.v2.vue @@ -697,6 +697,11 @@ function onPinNodes(ids: string[], source: PinDataSource) { } async function onSaveWorkflow() { + const workflowIsSaved = !uiStore.stateIsDirty; + + if (workflowIsSaved) { + return; + } const saved = await workflowHelpers.saveCurrentWorkflow(); if (saved) { canvasEventBus.emit('saved:workflow');