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 050b6f6 commit fa3327f
Showing 1 changed file with 18 additions and 29 deletions.
47 changes: 18 additions & 29 deletions cypress/e2e/resize-handle.component.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,26 @@ 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\']').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\'] 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\']').invoke('css', 'transform')
// .should('equal', 'matrix(1, 0, 0, 1, -50, -50)');
// 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', 'width')
// .should('equal', '170px');
// 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');
// });

});
});

Expand Down

0 comments on commit fa3327f

Please sign in to comment.