Merge branch 'patch-1' of github.com:lounsbrough/react-flow into lounsbrough-patch-1
This commit is contained in:
@@ -35,17 +35,20 @@ describe('Minimap Testing', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('changes node position', () => {
|
it('changes node position', () => {
|
||||||
const xPosBeforeDrag = Cypress.$('.react-flow__minimap-node:first').attr('x');
|
const minimapNode = Cypress.$('.react-flow__minimap-node:first');
|
||||||
const yPosBeforeDrag = Cypress.$('.react-flow__minimap-node:first').attr('y');
|
|
||||||
|
const xPosBeforeDrag = Number(minimapNode.attr('x'));
|
||||||
|
const yPosBeforeDrag = Number(minimapNode.attr('y'));
|
||||||
|
|
||||||
cy.drag('.react-flow__node:first', { x: 500, y: 25 })
|
cy.drag('.react-flow__node:first', { x: 500, y: 25 })
|
||||||
.wait(100)
|
.wait(100)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const xPosAfterDrag = Cypress.$('.react-flow__minimap-node:first').attr('x');
|
const xPosAfterDrag = Number(minimapNode.attr('x'));
|
||||||
const yPosAfterDrag = Cypress.$('.react-flow__minimap-node:first').attr('y');
|
const yPosAfterDrag = Number(minimapNode.attr('y'));
|
||||||
|
|
||||||
expect(xPosBeforeDrag).to.not.equal(xPosAfterDrag);
|
expect(xPosAfterDrag).not.to.equal(xPosBeforeDrag);
|
||||||
expect(yPosBeforeDrag).to.not.equal(yPosAfterDrag);
|
expect(yPosAfterDrag).not.to.equal(yPosBeforeDrag);
|
||||||
|
expect(xPosAfterDrag - xPosBeforeDrag).to.be.greaterThan(yPosAfterDrag - yPosBeforeDrag);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ function MiniMap({
|
|||||||
<MiniMapNode
|
<MiniMapNode
|
||||||
key={node.id}
|
key={node.id}
|
||||||
x={positionAbsolute.x}
|
x={positionAbsolute.x}
|
||||||
y={positionAbsolute.x}
|
y={positionAbsolute.y}
|
||||||
width={node.width!}
|
width={node.width!}
|
||||||
height={node.height!}
|
height={node.height!}
|
||||||
style={node.style}
|
style={node.style}
|
||||||
|
|||||||
Reference in New Issue
Block a user