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,34 @@
import { useVueFlow } from '@vue-flow/core'
import { getElements } from '../../../utils'
const { nodes, edges } = getElements(2, 2)
describe('Store Action: `updateEdge`', () => {
const store = useVueFlow({ id: 'test' })
let randomIndex: number
beforeEach(() => {
cy.vueFlow({
nodes,
edges,
})
})
beforeEach(() => {
randomIndex = Math.floor(Math.random() * edges.length)
})
it('updates edge', () => {
store.updateEdge(store.edges.value[randomIndex], {
sourceHandle: null,
targetHandle: null,
source: nodes[0].id,
target: nodes[1].id,
})
const storedEdge = store.edges.value[randomIndex]
expect(storedEdge.source).to.equal(nodes[0].id)
expect(storedEdge.target).to.equal(nodes[1].id)
})
})