mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
test(editor): Update workflow actions tests for the new canvas (no-changelog) (#12245)
Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
committed by
GitHub
parent
3006ccf41b
commit
8cce588209
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user