diff --git a/.gitignore b/.gitignore index bb9ba8d0..cfaa6b14 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .DS_Store .cache node_modules -examples/build \ No newline at end of file +examples/build +cypress/videos +cypress/screenshots \ No newline at end of file diff --git a/cypress.json b/cypress.json index 53a9bb5f..0d54e2d7 100644 --- a/cypress.json +++ b/cypress.json @@ -1,3 +1,5 @@ { - "baseUrl": "http://localhost:1234" + "baseUrl": "http://localhost:1234", + "viewportWidth": 1280, + "viewportHeight": 720 } diff --git a/cypress/integration/flow/basic.spec.js b/cypress/integration/flow/basic.spec.js index 3b519b5b..ced19793 100644 --- a/cypress/integration/flow/basic.spec.js +++ b/cypress/integration/flow/basic.spec.js @@ -15,6 +15,24 @@ describe('Basic Flow Rendering', () => { cy.get('.react-graph__node:first').click().should('have.class', 'selected'); }); + it('deselects node', () => { + cy.get('.react-graph__renderer').click(0, 0); + cy.get('.react-graph__node:first').should('not.have.class', 'selected'); + }); + + it('select all nodes', () => { + // @FIX: why is there no selection__pane visible? + // https://docs.cypress.io/api/commands/type.html#Do-a-shift-click + cy.get('body') + .type('{shift}', { release: false }) + .get('.react-graph__selectionpane') + .trigger('mousedown', 'topLeft', { which: 1, force: true }) + .trigger('mousemove', 'bottomRight', { which: 1 }) + .trigger('mouseup', 'bottomRight', { force: true }); + + cy.get('.react-graph__node').should('have.class', 'selected'); + }); + it('selects an edge', () => { cy.get('.react-graph__edge:first').click().should('have.class', 'selected'); }); diff --git a/cypress/videos/flow/basic.spec.js.mp4 b/cypress/videos/flow/basic.spec.js.mp4 deleted file mode 100644 index 7c386698..00000000 Binary files a/cypress/videos/flow/basic.spec.js.mp4 and /dev/null differ