mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
test: Add stickies tests (#5413)
* test: Add tests for stickies * test: add sticky basic test * test: add size dragging tests * test: add delete sticky test * test: add editing test * test: update editing text * test: add expansion tests * test: add more tests * test: clean up tests * refactor: update dragging tests to make sense * refactor: upate drag right test * test: add shrink from right test * test: refactor some more * test: fix all tests * test: clean up * test: update number * test: add z-index tests * test: address comments * test: fix mistake * test: wait on save * test: try button instead
This commit is contained in:
@@ -232,18 +232,19 @@ Cypress.Commands.add('paste', { prevSubject: true }, (selector, pastePayload) =>
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('drag', (selector, pos) => {
|
||||
Cypress.Commands.add('drag', (selector, pos, options) => {
|
||||
const index = options?.index || 0;
|
||||
const [xDiff, yDiff] = pos;
|
||||
const element = cy.get(selector);
|
||||
const element = cy.get(selector).eq(index);
|
||||
element.should('exist');
|
||||
|
||||
const originalLocation = Cypress.$(selector)[0].getBoundingClientRect();
|
||||
const originalLocation = Cypress.$(selector)[index].getBoundingClientRect();
|
||||
|
||||
element.trigger('mousedown');
|
||||
element.trigger('mousemove', {
|
||||
which: 1,
|
||||
pageX: originalLocation.right + xDiff,
|
||||
pageY: originalLocation.top + yDiff,
|
||||
pageX: options?.abs? xDiff: originalLocation.right + xDiff,
|
||||
pageY: options?.abs? yDiff: originalLocation.top + yDiff,
|
||||
force: true,
|
||||
});
|
||||
element.trigger('mouseup', { force: true });
|
||||
|
||||
Reference in New Issue
Block a user