Skip to content

Commit

Permalink
fix and re-enable e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Ivaniv <[email protected]>
  • Loading branch information
OlegIvaniv authored and netroy committed Oct 2, 2023
1 parent 3038556 commit 5e60014
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/10-undo-redo.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('Undo/Redo', () => {
WorkflowPage.getters.nodeConnections().should('have.length', 0);
});

it.only('should undo/redo deleting a connection by moving it away', () => {
it('should undo/redo deleting a connection by moving it away', () => {
WorkflowPage.actions.addNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
cy.drag('.rect-input-endpoint.jtk-endpoint-connected', [0, -100]);
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/12-canvas.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Canvas Node Manipulation and Navigation', () => {
}
});

it.only('should add merge node and test connections', () => {
it('should add merge node and test connections', () => {
WorkflowPage.actions.addNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
WorkflowPage.getters.canvasNodeByName(MANUAL_TRIGGER_NODE_DISPLAY_NAME).click();
for (let i = 0; i < 2; i++) {
Expand Down Expand Up @@ -158,7 +158,7 @@ describe('Canvas Node Manipulation and Navigation', () => {
WorkflowPage.getters.canvasNodeByName(MANUAL_TRIGGER_NODE_DISPLAY_NAME).click();
WorkflowPage.actions.addNodeToCanvas(CODE_NODE_NAME);
WorkflowPage.actions.zoomToFit();
cy.drag('[data-test-id="canvas-node"].jtk-drag-selected', [50, 150]);
cy.drag('[data-test-id="canvas-node"].jtk-drag-selected', [50, 150], { clickToFinish: true });
WorkflowPage.getters
.canvasNodes()
.last()
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/24-ndv-paired-item.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('NDV', () => {
ndv.getters.parameterExpressionPreview('value').should('include.text', '1111');
});

it.skip('maps paired input and output items based on selected run', () => {
it('maps paired input and output items based on selected run', () => {
cy.fixture('Test_workflow_5.json').then((data) => {
cy.get('body').paste(JSON.stringify(data));
});
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/5-ndv.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('NDV', () => {
ndv.getters.container().should('not.be.visible');
});

it.only('should test webhook node', () => {
it('should test webhook node', () => {
workflowPage.actions.addInitialNodeToCanvas('Webhook');
workflowPage.getters.canvasNodes().first().dblclick();

Expand Down Expand Up @@ -198,7 +198,7 @@ describe('NDV', () => {
});
});

it.only('can link and unlink run selectors between input and output', () => {
it('can link and unlink run selectors between input and output', () => {
cy.createFixtureWorkflow('Test_workflow_5.json', 'Test');
workflowPage.actions.zoomToFit();
workflowPage.actions.executeWorkflow();
Expand Down Expand Up @@ -322,7 +322,7 @@ describe('NDV', () => {
getVisibleSelect().find('.el-select-dropdown__item').should('have.length', 3);
});

it.only('should flag issues as soon as params are set', () => {
it('should flag issues as soon as params are set', () => {
workflowPage.actions.addInitialNodeToCanvas('Webhook');
workflowPage.getters.canvasNodes().first().dblclick();

Expand Down
9 changes: 5 additions & 4 deletions packages/editor-ui/src/components/InputPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,11 @@ export default defineComponent({
watch: {
inputMode: {
handler(val) {
this.onRunIndexChange(0);
this.onUnlinkRun();
this.mappedNode = val === 'mapping' ? this.rootNodesParents[0] : null;
this.onRunIndexChange(-1);
if (val === 'mapping') {
this.onUnlinkRun();
this.mappedNode = this.rootNodesParents[0];
}
},
immediate: true,
},
Expand Down
5 changes: 0 additions & 5 deletions packages/editor-ui/src/components/NodeDetailsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,6 @@ export default defineComponent({
const workflowNode = this.workflow.getNode(this.activeNode.name);
const outputs = NodeHelpers.getNodeOutputs(this.workflow, workflowNode, this.activeNodeType);
// TODO: Do we need to prevent from switching runs for non-main nodes?
// if (!outputs.includes(NodeConnectionType.Main)) {
// return 0;
// }
let node = this.inputNode;
const runData: IRunData | null = this.workflowRunData;
Expand Down
6 changes: 5 additions & 1 deletion packages/editor-ui/src/components/NodeSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ export default defineComponent({
return this.readOnly || this.hasForeignCredential;
},
isExecutable(): boolean {
if (this.nodeType && !this.nodeType.inputs.includes(NodeConnectionType.Main)) {
if (
this.nodeType &&
!this.isTriggerNode &&
!this.nodeType.inputs.includes(NodeConnectionType.Main)
) {
return false;
}
return this.executable || this.hasForeignCredential;
Expand Down
3 changes: 0 additions & 3 deletions packages/editor-ui/src/mixins/nodeBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,13 @@ export const nodeBase = defineComponent({
connectionType: ConnectionTypes,
nodeTypeData: INodeTypeDescription,
): EndpointOptions {
const type = 'input';

if (connectionType === NodeConnectionType.Main) {
return {
paintStyle: NodeViewUtils.getInputEndpointStyle(
nodeTypeData,
this.__getEndpointColor(NodeConnectionType.Main),
connectionType,
),
cssClass: `dot-${type}-endpoint`,
};
}

Expand Down
13 changes: 6 additions & 7 deletions packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ import Sticky from '@/components/Sticky.vue';
import CanvasAddButton from './CanvasAddButton.vue';
import { v4 as uuid } from 'uuid';
import type {
ConnectionTypes,
IConnection,
IConnections,
IDataObject,
Expand All @@ -263,6 +262,7 @@ import type {
ITelemetryTrackProperties,
IWorkflowBase,
Workflow,
ConnectionTypes,
} from 'n8n-workflow';
import { deepCopy, NodeConnectionType, NodeHelpers, TelemetryHelpers } from 'n8n-workflow';
import type {
Expand Down Expand Up @@ -599,7 +599,7 @@ export default defineComponent({
}
if (this.connectionDragScope.type) {
returnClasses.push(`connection-drag-scope-active`);
returnClasses.push('connection-drag-scope-active');
returnClasses.push(`connection-drag-scope-active-type-${this.connectionDragScope.type}`);
returnClasses.push(
`connection-drag-scope-active-connection-${this.connectionDragScope.connection}`,
Expand Down Expand Up @@ -2102,9 +2102,8 @@ export default defineComponent({
targetNodeOuputIndex: number,
type: ConnectionTypes,
): IConnection | undefined {
const nodeConnections = (
this.workflowsStore.outgoingConnectionsByNodeName(sourceNodeName) as INodeConnections
)[type];
const nodeConnections =
this.workflowsStore.outgoingConnectionsByNodeName(sourceNodeName)[type];
if (nodeConnections) {
const connections: IConnection[] | null = nodeConnections[sourceNodeOutputIndex];
Expand Down Expand Up @@ -2819,7 +2818,7 @@ export default defineComponent({
}
},
onAddInputEndpointClick(endpoint: Endpoint) {
if (endpoint && endpoint.__meta) {
if (endpoint?.__meta) {
this.insertNodeAfterSelected({
sourceId: endpoint.__meta.nodeId,
index: endpoint.__meta.index,
Expand Down Expand Up @@ -3346,7 +3345,7 @@ export default defineComponent({
const outputMap = NodeViewUtils.getOutputSummary(
data,
nodeConnections || [],
connectionType as ConnectionTypes,
(connectionType as ConnectionTypes) ?? NodeConnectionType.Main,
);
Object.keys(outputMap).forEach((sourceOutputIndex: string) => {
Expand Down

0 comments on commit 5e60014

Please sign in to comment.