mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +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');
|
cy.get('#node-creator').should('not.exist');
|
||||||
|
|
||||||
WorkflowPage.actions.hitSelectAll();
|
WorkflowPage.actions.hitSelectAll();
|
||||||
cy.get('.jtk-drag-selected').should('have.length', 2);
|
|
||||||
WorkflowPage.actions.hitCopy();
|
WorkflowPage.actions.hitCopy();
|
||||||
successToast().should('exist');
|
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)', () => {
|
it('should paste nodes (both current and old node versions)', () => {
|
||||||
@@ -345,7 +352,15 @@ describe('Workflow Actions', () => {
|
|||||||
WorkflowPage.actions.hitDeleteAllNodes();
|
WorkflowPage.actions.hitDeleteAllNodes();
|
||||||
WorkflowPage.getters.canvasNodes().should('have.length', 0);
|
WorkflowPage.getters.canvasNodes().should('have.length', 0);
|
||||||
// Button should be disabled
|
// 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
|
// Keyboard shortcut should not work
|
||||||
WorkflowPage.actions.hitExecuteWorkflow();
|
WorkflowPage.actions.hitExecuteWorkflow();
|
||||||
successToast().should('not.exist');
|
successToast().should('not.exist');
|
||||||
|
|||||||
@@ -697,6 +697,11 @@ function onPinNodes(ids: string[], source: PinDataSource) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function onSaveWorkflow() {
|
async function onSaveWorkflow() {
|
||||||
|
const workflowIsSaved = !uiStore.stateIsDirty;
|
||||||
|
|
||||||
|
if (workflowIsSaved) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const saved = await workflowHelpers.saveCurrentWorkflow();
|
const saved = await workflowHelpers.saveCurrentWorkflow();
|
||||||
if (saved) {
|
if (saved) {
|
||||||
canvasEventBus.emit('saved:workflow');
|
canvasEventBus.emit('saved:workflow');
|
||||||
|
|||||||
Reference in New Issue
Block a user