Skip to content

Commit

Permalink
Update resize-handle.component.cy.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
siarheihuzarevich committed Jan 13, 2025
1 parent 49d1979 commit 050b6f6
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions cypress/e2e/resize-handle.component.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,37 @@ describe('ResizeHandleComponent', () => {
cy.get('div[data-f-node-id=\'f-node-0\']').invoke('css', 'width')
.should('equal', '120px');

cy.get('div[data-f-node-id=\'f-node-0\'] div[data-f-resize-handle-type$=\'TOP\']')
.trigger('mousedown', { button: 0, force: true })
.trigger('mousemove', { clientX: 0, clientY: 0 })
.trigger('mousemove', { clientX: -50, clientY: -50 })
.trigger('mouseup');

cy.get('div[data-f-node-id=\'f-node-0\']').invoke('css', 'transform')
.should('equal', 'matrix(1, 0, 0, 1, -50, -50)');

cy.get('div[data-f-node-id=\'f-node-0\']').invoke('css', 'width')
.should('equal', '170px');
cy.get('div[data-f-node-id=\'f-node-0\'] div[data-f-resize-handle-type$=\'TOP\']').then(($target) => {
const targetRect = $target[ 0 ].getBoundingClientRect();
const endY = targetRect.y;
const endX = targetRect.x;

cy.log('YYY', endX, endY);

cy.get('div[data-f-node-id=\'f-node-0\'] div[data-f-resize-handle-type$=\'TOP\']')
.trigger('mousedown', { button: 0, force: true })
.trigger('mousemove', { clientX: 0 })
.trigger('mousemove', { clientX: endY - 50 })
.trigger('mouseup', { force: true });

cy.get('div[data-f-node-id=\'f-node-0\']').invoke('css', 'transform')
.should('equal', 'matrix(1, 0, 0, 1, 108, 0)');

cy.get('div[data-f-node-id=\'f-node-0\']').invoke('css', 'width')
.should('equal', '12px');
});


// cy.get('div[data-f-node-id=\'f-node-0\'] div[data-f-resize-handle-type$=\'TOP\']')
// .trigger('mousedown', { button: 0, force: true })
// .trigger('mousemove', { clientX: -50, clientY: -50 })
// .trigger('mouseup');
//
// cy.get('div[data-f-node-id=\'f-node-0\']').invoke('css', 'transform')
// .should('equal', 'matrix(1, 0, 0, 1, -50, -50)');
//
// cy.get('div[data-f-node-id=\'f-node-0\']').invoke('css', 'width')
// .should('equal', '170px');
});
});

Expand Down

0 comments on commit 050b6f6

Please sign in to comment.