update(test): add more flow tests
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
+2
-1
@@ -2,5 +2,6 @@
|
|||||||
"testFiles": "cypress/**/*.spec.ts",
|
"testFiles": "cypress/**/*.spec.ts",
|
||||||
"componentFolder": ".",
|
"componentFolder": ".",
|
||||||
"video": false,
|
"video": false,
|
||||||
"screenshotOnRunFailure": false
|
"screenshotOnRunFailure": false,
|
||||||
|
"retries": 2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ describe('Render VueFlow', () => {
|
|||||||
{ id: 'e1-2', source: '1', target: '2', animated: true },
|
{ id: 'e1-2', source: '1', target: '2', animated: true },
|
||||||
]
|
]
|
||||||
|
|
||||||
it('renders a Vue Flow container', () => {
|
beforeEach(() => {
|
||||||
mount(VueFlow, {
|
mount(VueFlow, {
|
||||||
props: {
|
props: {
|
||||||
modelValue: elements,
|
modelValue: elements,
|
||||||
@@ -23,12 +23,25 @@ describe('Render VueFlow', () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
cy.get('.vue-flow')
|
|
||||||
.should('exist')
|
|
||||||
.get('.vue-flow__node')
|
|
||||||
.should('have.length', elements.filter(isNode).length)
|
|
||||||
.get('.vue-flow__edge')
|
|
||||||
.should('have.length', elements.filter(isEdge).length)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('renders a Vue Flow container', () => {
|
||||||
|
cy.get('.vue-flow').should('exist')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders nodes', () => {
|
||||||
|
cy.get('.vue-flow__node').should('have.length', elements.filter(isNode).length)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders edges', () => cy.get('.vue-flow__edge').should('have.length', elements.filter(isEdge).length))
|
||||||
|
|
||||||
|
it('renders correct node labels', () =>
|
||||||
|
cy.get('.vue-flow__node').each((node) => expect(elements.some((el) => el.data.label === node.text())).to.be.true))
|
||||||
|
|
||||||
|
it('renders nodes at correct position', () =>
|
||||||
|
cy.get('.vue-flow__node').each((node) => {
|
||||||
|
expect(
|
||||||
|
elements.filter(isNode).some((el) => el.position.x === node.position().left && el.position.y === node.position().top),
|
||||||
|
).to.be.true
|
||||||
|
}))
|
||||||
})
|
})
|
||||||
|
|||||||
+1
-1
@@ -59,6 +59,6 @@ export default defineConfig({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: ['vue', '@vueuse/core', '@braks/revue-draggable'],
|
include: ['vue', '@vueuse/core', '@braks/revue-draggable', 'd3-zoom', 'd3-selection'],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user