refactor(tests): rename e2e to tests

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-22 20:20:11 +01:00
committed by Braks
parent c60398d0f0
commit a3ec3b40a7
43 changed files with 10 additions and 1 deletions
@@ -0,0 +1,32 @@
import { getElements } from '../../utils'
const { nodes, edges } = getElements()
describe('Render Basic Example', () => {
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,
))
})