refactor(examples): rename Advanced to CustomNodes, use func component

This commit is contained in:
moklick
2019-10-22 22:37:05 +02:00
parent bd60ad0ecd
commit 02005917f8
14 changed files with 2291 additions and 285 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
describe('Basic Flow Rendering', () => {
describe('Basic Graph Rendering', () => {
it('renders a flow with three nodes', () => {
cy.visit('/basic');
@@ -1,11 +1,11 @@
describe('Advanced Flow Rendering', () => {
describe('Custom Nodes Graph Rendering', () => {
it('renders a flow with sone nodes', () => {
cy.visit('/');
cy.get('.react-flow__renderer');
cy.get('.react-flow__node').should('have.length', 9);
cy.get('.react-flow__edge').should('have.length', 9);
cy.get('.react-flow__node').should('have.length', 8);
cy.get('.react-flow__edge').should('have.length', 8);
});
it('renders a grid', () => {
@@ -31,7 +31,7 @@ describe('Advanced Flow Rendering', () => {
.should('not.have.class', 'valid')
.should('not.have.class', 'connecting');
cy.get('.react-flow__edge').should('have.length', 10);
cy.get('.react-flow__edge').should('have.length', 9);
});
it('tries to make invalid connection', () => {
@@ -50,6 +50,6 @@ describe('Advanced Flow Rendering', () => {
.trigger('mouseup', { force: true })
.should('not.have.class', 'connecting');
cy.get('.react-flow__edge').should('have.length', 10);
cy.get('.react-flow__edge').should('have.length', 9);
});
});
+17
View File
@@ -0,0 +1,17 @@
describe('Empty Flow Rendering', () => {
it('renders an empty graph', () => {
cy.visit('/empty');
cy.get('.react-flow__renderer');
cy.get('.react-flow__node').should('not.exist');
cy.get('.react-flow__edge').should('not.exist');
});
it('renders a control panel', () => {
cy.get('.react-flow__controls');
});
it('renders a mini map', () => {
cy.get('.react-flow__minimap');
});
});