refactor(inactivemode): no pointer events for nodes and edges closes #218
This commit is contained in:
@@ -33,7 +33,7 @@ describe('Empty Flow Rendering', () => {
|
||||
});
|
||||
|
||||
it('uses lock view control', () => {
|
||||
cy.get('.react-flow__controls-interactive').click();
|
||||
cy.get('.react-flow__controls-interactive');
|
||||
});
|
||||
|
||||
it('renders an empty mini map', () => {
|
||||
|
||||
@@ -9,11 +9,13 @@ describe('Inactive Graph Rendering', () => {
|
||||
});
|
||||
|
||||
it('tries to select a node by click', () => {
|
||||
cy.get('.react-flow__node:first').click().should('have.not.class', 'selected');
|
||||
const pointerEvents = Cypress.$('.react-flow__node:first').css('pointer-events');
|
||||
expect(pointerEvents).to.equal('none');
|
||||
});
|
||||
|
||||
it('tries to select an edge by click', () => {
|
||||
cy.get('.react-flow__edge:first').click().should('have.not.class', 'selected');
|
||||
const pointerEvents = Cypress.$('.react-flow__edge:first').css('pointer-events');
|
||||
expect(pointerEvents).to.equal('none');
|
||||
});
|
||||
|
||||
it('tries to do a selection', () => {
|
||||
@@ -22,30 +24,6 @@ describe('Inactive Graph Rendering', () => {
|
||||
cy.get('body').type('{shift}', { release: true });
|
||||
});
|
||||
|
||||
it('tries to drag a node', () => {
|
||||
const styleBeforeDrag = Cypress.$('.react-flow__node:first').css('transform');
|
||||
|
||||
cy.drag('.react-flow__node:first', { x: 500, y: 25 }).then(($el) => {
|
||||
const styleAfterDrag = $el.css('transform');
|
||||
expect(styleBeforeDrag).to.equal(styleAfterDrag);
|
||||
});
|
||||
});
|
||||
|
||||
it('tries to connect nodes', () => {
|
||||
cy.get('.react-flow__node')
|
||||
.contains('Node 3')
|
||||
.find('.react-flow__handle.source')
|
||||
.trigger('mousedown', { which: 1 });
|
||||
|
||||
cy.get('.react-flow__node')
|
||||
.contains('Node 4')
|
||||
.find('.react-flow__handle.target')
|
||||
.trigger('mousemove')
|
||||
.trigger('mouseup', { force: true });
|
||||
|
||||
cy.get('.react-flow__edge').should('have.length', 2);
|
||||
});
|
||||
|
||||
it('toggles interactive mode', () => {
|
||||
cy.get('.react-flow__interactive').click();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user