Files
vue-flow/e2e/cypress/component/1-store/nodes/addNodes.cy.ts
2022-10-08 23:25:34 +02:00

29 lines
684 B
TypeScript

import { useVueFlow } from '@vue-flow/core'
import { getElements } from '../../../utils'
const { nodes } = getElements()
const initialNodes = [{ id: '1e3', position: { x: 0, y: 0 }, label: 'Node 1e3' }]
describe('Store Action: `addNodes`', () => {
const store = useVueFlow({ id: 'test' })
beforeEach(() => {
cy.vueFlow({
nodes: initialNodes,
})
})
beforeEach(() => {
store.addNodes(nodes)
})
it('adds nodes to store', () => {
expect(store.nodes.value).to.have.length(nodes.length + initialNodes.length)
})
it('adds nodes to viewpane', () => {
cy.get('.vue-flow__node').should('have.length', nodes.length + initialNodes.length)
})
})