refactor(tests): move test files

This commit is contained in:
braks
2022-10-07 22:55:38 +02:00
committed by Braks
parent 9fde0bc1af
commit 6e0c0c7768
19 changed files with 17 additions and 17 deletions
+32
View File
@@ -0,0 +1,32 @@
import { getElements } from '../../utils'
const { nodes, edges } = getElements()
describe('render Vue Flow', () => {
beforeEach(() => {
cy.vueFlow({
modelValue: [...nodes, ...edges],
})
})
it('renders a Vue Flow container', () => {
cy.get('.vue-flow').should('exist')
})
it('renders nodes', () => {
cy.get('.vue-flow__node').should('have.length', nodes.length)
})
it('renders edges', () => cy.get('.vue-flow__edge').should('have.length', edges.length))
it('renders correct node labels', () =>
cy.get('.vue-flow__node').each((node) => expect(nodes.some((el) => el.label === node.text())).to.be.true))
it('renders nodes at correct position', () =>
cy
.get('.vue-flow__node')
.each(
(node) =>
expect(nodes.some((el) => el.position.x === node.position().left && el.position.y === node.position().top)).to.be.true,
))
})