diff --git a/examples/vite-app/cypress/e2e/minimap.cy.ts b/examples/vite-app/cypress/e2e/minimap.cy.ts index d6cb7d46..46a5a819 100644 --- a/examples/vite-app/cypress/e2e/minimap.cy.ts +++ b/examples/vite-app/cypress/e2e/minimap.cy.ts @@ -35,17 +35,20 @@ describe('Minimap Testing', () => { }); it('changes node position', () => { - const xPosBeforeDrag = Cypress.$('.react-flow__minimap-node:first').attr('x'); - const yPosBeforeDrag = Cypress.$('.react-flow__minimap-node:first').attr('y'); + const minimapNode = Cypress.$('.react-flow__minimap-node:first'); + + const xPosBeforeDrag = Number(minimapNode.attr('x')); + const yPosBeforeDrag = Number(minimapNode.attr('y')); cy.drag('.react-flow__node:first', { x: 500, y: 25 }) .wait(100) .then(() => { - const xPosAfterDrag = Cypress.$('.react-flow__minimap-node:first').attr('x'); - const yPosAfterDrag = Cypress.$('.react-flow__minimap-node:first').attr('y'); + const xPosAfterDrag = Number(minimapNode.attr('x')); + const yPosAfterDrag = Number(minimapNode.attr('y')); - expect(xPosBeforeDrag).to.not.equal(xPosAfterDrag); - expect(yPosBeforeDrag).to.not.equal(yPosAfterDrag); + expect(xPosAfterDrag).not.to.equal(xPosBeforeDrag); + expect(yPosAfterDrag).not.to.equal(yPosBeforeDrag); + expect(xPosAfterDrag - xPosBeforeDrag).to.be.greaterThan(yPosAfterDrag - yPosBeforeDrag); }); }); diff --git a/examples/vite-app/package.json b/examples/vite-app/package.json index cf31055e..677f7289 100644 --- a/examples/vite-app/package.json +++ b/examples/vite-app/package.json @@ -1,7 +1,7 @@ { "name": "@reactflow/examples", "private": true, - "version": "0.0.1", + "version": "0.0.0", "type": "module", "scripts": { "dev": "vite --port 3000 --open", diff --git a/packages/minimap/CHANGELOG.md b/packages/minimap/CHANGELOG.md index 36a8f029..bcefc201 100644 --- a/packages/minimap/CHANGELOG.md +++ b/packages/minimap/CHANGELOG.md @@ -1,5 +1,11 @@ # @reactflow/minimap +## 11.2.2 + +### Patch Changes + +- [`7ece618d`](https://github.com/wbkd/react-flow/commit/7ece618d94b76183c1ecd45b16f6ab168168351b) Thanks [@](https://github.com/lounsbrough)! - Fix minimap node position + ## 11.2.1 ### Patch Changes diff --git a/packages/minimap/package.json b/packages/minimap/package.json index e2b66d07..d6dc1331 100644 --- a/packages/minimap/package.json +++ b/packages/minimap/package.json @@ -1,6 +1,6 @@ { "name": "@reactflow/minimap", - "version": "11.2.1", + "version": "11.2.2", "description": "Minimap component for React Flow.", "keywords": [ "react", diff --git a/packages/minimap/src/MiniMap.tsx b/packages/minimap/src/MiniMap.tsx index 890df176..722f1423 100644 --- a/packages/minimap/src/MiniMap.tsx +++ b/packages/minimap/src/MiniMap.tsx @@ -173,7 +173,7 @@ function MiniMap({