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
@@ -0,0 +1,29 @@
import { useVueFlow } from '@braks/vue-flow'
import { getElements } from '../../../utils'
const { nodes, edges } = getElements()
describe('Store Action: `findEdge`', () => {
const store = useVueFlow({ id: 'test' })
let randomIndex: number
beforeEach(() => {
cy.vueFlow({
nodes,
edges,
})
})
beforeEach(() => {
randomIndex = Math.floor(Math.random() * edges.length)
})
it('finds edge in store', () => {
const storedEdge = store.findEdge(edges[randomIndex].id)
expect(storedEdge?.id).to.equal(edges[randomIndex].id)
})
it('does not find edge in store when passed invalid id', () => {
expect(store.findEdge('-123')).to.equal(undefined)
})
})