fix(cypress): change example urls in tests

This commit is contained in:
Christopher Möller
2022-07-27 11:35:52 +02:00
parent 141a9763f8
commit a2e99d3a80
9 changed files with 78 additions and 25 deletions
+27 -8
View File
@@ -10,6 +10,9 @@ describe('Minimap Testing', () => {
it('has same number of nodes as the pane', () => {
const paneNodes = Cypress.$('.react-flow__node').length;
cy.wait(100);
const minimapNodes = Cypress.$('.react-flow__minimap-node').length;
cy.wait(100);
@@ -25,8 +28,12 @@ describe('Minimap Testing', () => {
.trigger('wheel', 'topLeft', { deltaY: -200 })
.wait(50)
.then(() => {
const viewBoxAfterZoom = Cypress.$('.react-flow__minimap').attr('viewBox');
const maskPathAfterZoom = Cypress.$('.react-flow__minimap-mask').attr('d');
const viewBoxAfterZoom = Cypress.$('.react-flow__minimap').attr(
'viewBox'
);
const maskPathAfterZoom = Cypress.$('.react-flow__minimap-mask').attr(
'd'
);
expect(viewBoxBeforeZoom).to.not.equal(viewBoxAfterZoom);
expect(maskPathBeforeZoom).to.not.equal(maskPathAfterZoom);
@@ -34,14 +41,22 @@ 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 xPosBeforeDrag = Cypress.$('.react-flow__minimap-node:first').attr(
'x'
);
const yPosBeforeDrag = Cypress.$('.react-flow__minimap-node:first').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 = Cypress.$('.react-flow__minimap-node:first').attr(
'x'
);
const yPosAfterDrag = Cypress.$('.react-flow__minimap-node:first').attr(
'y'
);
expect(xPosBeforeDrag).to.not.equal(xPosAfterDrag);
expect(yPosBeforeDrag).to.not.equal(yPosAfterDrag);
@@ -61,8 +76,12 @@ describe('Minimap Testing', () => {
.wait(50)
.trigger('mouseup', { force: true, view: win })
.then(() => {
const viewBoxAfterDrag = Cypress.$('.react-flow__minimap').attr('viewBox');
const maskPathAfterDrag = Cypress.$('.react-flow__minimap-mask').attr('d');
const viewBoxAfterDrag = Cypress.$('.react-flow__minimap').attr(
'viewBox'
);
const maskPathAfterDrag = Cypress.$('.react-flow__minimap-mask').attr(
'd'
);
expect(viewBoxBeforeDrag).to.not.equal(viewBoxAfterDrag);
expect(maskPathBeforeDrag).to.not.equal(maskPathAfterDrag);