feat(tests): add zoom

This commit is contained in:
moklick
2019-10-04 13:45:31 +02:00
parent 1d3403ea10
commit cd558f22ee

View File

@@ -80,14 +80,31 @@ describe('Basic Flow Rendering', () => {
const newPosition = {
clientX: Cypress.config('viewportWidth') * 0.6,
clientY: Cypress.config('viewportHeight') * 0.6
clientY: Cypress.config('viewportHeight') * 0.7
};
const styleBeforeDrag = Cypress.$('.react-graph__nodes').css('transform');
cy.window().then((win) => {
cy.get('.react-graph__zoompane')
.trigger('mousedown', { which: 1, view: win })
.trigger('mousemove', newPosition)
.trigger('mouseup', { force: true, view: win });
.trigger('mouseup', { force: true, view: win })
.then(() => {
const styleAfterDrag = Cypress.$('.react-graph__nodes').css('transform');
expect(styleBeforeDrag).to.not.equal(styleAfterDrag);
});
});
});
it('zooms the pane', () => {
const styleBeforeZoom = Cypress.$('.react-graph__nodes').css('transform');
cy.get('.react-graph__zoompane')
.trigger('wheel','topLeft', { deltaY: -200 })
.then(() => {
const styleAfterZoom = Cypress.$('.react-graph__nodes').css('transform');
expect(styleBeforeZoom).to.not.equal(styleAfterZoom);
});
});
});