refactor(tests): rename e2e to tests
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { useVueFlow } from '@vue-flow/core'
|
||||
import { getElements } from '../../../utils'
|
||||
|
||||
const { nodes, edges } = getElements()
|
||||
|
||||
describe('Store Action: `findNode`', () => {
|
||||
const store = useVueFlow({ id: 'test' })
|
||||
let randomIndex: number
|
||||
|
||||
beforeEach(() => {
|
||||
cy.vueFlow({
|
||||
nodes,
|
||||
edges,
|
||||
})
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
randomIndex = Math.floor(Math.random() * nodes.length)
|
||||
})
|
||||
|
||||
it('finds node in store', () => {
|
||||
const storedNode = store.findNode(nodes[randomIndex].id)
|
||||
expect(storedNode?.id).to.equal(nodes[randomIndex].id)
|
||||
})
|
||||
|
||||
it('does not find node in store when passed invalid id', () => {
|
||||
expect(store.findNode('-123')).to.equal(undefined)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user