diff --git a/cypress/e2e/4-node-creator.cy.ts b/cypress/e2e/4-node-creator.cy.ts index 731398db53..fdd4e0e7d2 100644 --- a/cypress/e2e/4-node-creator.cy.ts +++ b/cypress/e2e/4-node-creator.cy.ts @@ -1,6 +1,7 @@ import { NodeCreator } from '../pages/features/node-creator'; import { WorkflowPage as WorkflowPageClass } from '../pages/workflow'; import { NDV } from '../pages/ndv'; +import { getVisibleSelect } from '../utils'; const nodeCreatorFeature = new NodeCreator(); const WorkflowPage = new WorkflowPageClass(); @@ -88,14 +89,14 @@ describe('Node Creator', () => { NDVModal.getters.parameterInput('operation').find('input').should('have.value', 'Crop'); }); - it.only('should search through actions and confirm added action', () => { + it('should search through actions and confirm added action', () => { nodeCreatorFeature.actions.openNodeCreator(); nodeCreatorFeature.getters.searchBar().find('input').clear().type('ftp'); nodeCreatorFeature.getters.searchBar().find('input').type('{rightarrow}'); nodeCreatorFeature.getters.activeSubcategory().should('have.text', 'FTP'); nodeCreatorFeature.getters.searchBar().find('input').clear().type('file'); // Navigate to rename action which should be the 4th item - nodeCreatorFeature.getters.searchBar().find('input').type('{uparrow}{uparrow}{rightarrow}'); + nodeCreatorFeature.getters.searchBar().find('input').type('{uparrow}{rightarrow}'); NDVModal.getters.parameterInput('operation').find('input').should('have.value', 'Rename'); }); @@ -137,7 +138,7 @@ describe('Node Creator', () => { nodeCreatorFeature.getters .getCategoryItem('Triggers') .parent() - .should('not.have.attr', 'data-category-collapsed'); + .should('have.attr', 'data-category-collapsed', 'false'); nodeCreatorFeature.getters .getCategoryItem('Actions') .parent() @@ -146,7 +147,7 @@ describe('Node Creator', () => { nodeCreatorFeature.getters .getCategoryItem('Actions') .parent() - .should('not.have.attr', 'data-category-collapsed'); + .should('have.attr', 'data-category-collapsed', 'false'); }); it('should have "Triggers" section collapsed when opening actions view from Regular root view', () => { @@ -160,21 +161,21 @@ describe('Node Creator', () => { nodeCreatorFeature.getters .getCategoryItem('Actions') .parent() - .should('not.have.attr', 'data-category-collapsed'); + .should('have.attr', 'data-category-collapsed', 'false'); nodeCreatorFeature.getters.getCategoryItem('Actions').click(); nodeCreatorFeature.getters .getCategoryItem('Actions') .parent() - .should('have.attr', 'data-category-collapsed'); + .should('have.attr', 'data-category-collapsed', 'true'); nodeCreatorFeature.getters .getCategoryItem('Triggers') .parent() - .should('have.attr', 'data-category-collapsed'); + .should('have.attr', 'data-category-collapsed', 'true'); nodeCreatorFeature.getters.getCategoryItem('Triggers').click(); nodeCreatorFeature.getters .getCategoryItem('Triggers') .parent() - .should('not.have.attr', 'data-category-collapsed'); + .should('have.attr', 'data-category-collapsed', 'false'); }); it('should show callout and two suggested nodes if node has no trigger actions', () => { @@ -208,11 +209,7 @@ describe('Node Creator', () => { // Setup 1s interval execution cy.getByTestId('parameter-input-field').click(); - cy.getByTestId('parameter-input-field') - .find('.el-select-dropdown') - .find('.option-headline') - .contains('Seconds') - .click(); + getVisibleSelect().find('.option-headline').contains('Seconds').click(); cy.getByTestId('parameter-input-secondsInterval').clear().type('1'); NDVModal.actions.close(); @@ -296,6 +293,7 @@ describe('Node Creator', () => { }); }); + // @TODO FIX ADDING 2 NODES IN ONE GO it('should not append manual trigger when source is canvas related', () => { nodeCreatorFeature.getters.canvasAddButton().click(); nodeCreatorFeature.getters.searchBar().find('input').clear().type('n8n'); diff --git a/cypress/utils/popper.ts b/cypress/utils/popper.ts index 5952e77e02..608f43ee91 100644 --- a/cypress/utils/popper.ts +++ b/cypress/utils/popper.ts @@ -5,3 +5,7 @@ export function getVisiblePopper() { export function getVisibleSelect() { return getVisiblePopper().filter('.el-select__popper'); } + +export function getVisibleDropdown() { + return getVisiblePopper().filter('.el-select__dropdown'); +} diff --git a/packages/editor-ui/src/plugins/components.ts b/packages/editor-ui/src/plugins/components.ts index 4fa15b55b4..6b60d58651 100644 --- a/packages/editor-ui/src/plugins/components.ts +++ b/packages/editor-ui/src/plugins/components.ts @@ -14,7 +14,7 @@ export const GlobalComponentsPlugin: Plugin<{}> = { const messageService = useMessage(); app.component('enterprise-edition', EnterpriseEdition); - app.component('fragment', Fragment); + app.component('Fragment', Fragment); app.use(ElementPlus); app.use(N8nPlugin); diff --git a/packages/editor-ui/src/stores/workflows.store.ts b/packages/editor-ui/src/stores/workflows.store.ts index 844aa15e46..e0d521ad6c 100644 --- a/packages/editor-ui/src/stores/workflows.store.ts +++ b/packages/editor-ui/src/stores/workflows.store.ts @@ -965,6 +965,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, { }, removeNode(node: INodeUi): void { + const uiStore = useUIStore(); const { [node.name]: removedNodeMetadata, ...remainingNodeMetadata } = this.nodeMetadata; this.nodeMetadata = remainingNodeMetadata; @@ -978,8 +979,13 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, { for (let i = 0; i < this.workflow.nodes.length; i++) { if (this.workflow.nodes[i].name === node.name) { - this.workflow.nodes.splice(i, 1); - const uiStore = useUIStore(); + this.workflow = { + ...this.workflow, + nodes: [...this.workflow.nodes.slice(0, i), ...this.workflow.nodes.slice(i + 1)], + }; + + console.log(this.workflow); + uiStore.stateIsDirty = true; return; }