fix(editor): Fix redo when adding node on connection (#6833)

* fix(editor): Fix redo when adding node on connection
*  Adding tests for pushed nodes
* ✔️ Updating drag command for dragging nodes on the canvas
* 👌 Handling drag end with a command  option
This commit is contained in:
Milorad FIlipović
2023-08-02 12:48:55 +02:00
committed by GitHub
parent 0ac3d47f26
commit 4ac4b850dd
3 changed files with 26 additions and 8 deletions

View File

@@ -112,7 +112,6 @@ Cypress.Commands.add('drag', (selector, pos, options) => {
x: options?.abs ? xDiff : originalLocation.right + xDiff,
y: options?.abs ? yDiff : originalLocation.top + yDiff,
}
if(options?.realMouse) {
element.realMouseDown();
element.realMouseMove(newPosition.x, newPosition.y);
@@ -125,7 +124,13 @@ Cypress.Commands.add('drag', (selector, pos, options) => {
pageY: newPosition.y,
force: true,
});
element.trigger('mouseup', {force: true});
if (options?.clickToFinish) {
// Click to finish the drag
// For some reason, mouseup isn't working when moving nodes
cy.get('body').click(newPosition.x, newPosition.y);
} else {
element.trigger('mouseup', {force: true});
}
}
});
});