feat(tests): add drag test

This commit is contained in:
moklick
2019-09-25 23:04:03 +02:00
parent a6dbd8ebe1
commit 590d7c7db0
36 changed files with 94632 additions and 1926 deletions
+18 -3
View File
@@ -1,8 +1,23 @@
describe('Basis Flow', function() {
it('renders a flow with some nodes', function() {
describe('Basic Flow Rendering', () => {
it('renders a flow with three nodes', () => {
cy.visit('/basic.html');
cy.get('.react-graph__renderer');
cy.get('.react-graph__node').should('have.length', 3);
cy.get('.react-graph__edge').should('have.length', 2);
});
})
it('selects a node', () => {
cy.get('.react-graph__node:first').click().should('have.class', 'selected');
});
it('drags a node', () => {
const styleBeforeDrag = Cypress.$('.react-graph__node:first').css('transform');
cy.drag('.react-graph__node:first', { x: 500, y: 25 })
.then($el => {
const styleAfterDrag = $el.css('transform');
expect(styleBeforeDrag).to.not.equal(styleAfterDrag);
});
});
});