diff --git a/e2e/cypress/component/1-store/actions/edges/updateEdge.cy.ts b/e2e/cypress/component/1-store/actions/edges/updateEdge.cy.ts new file mode 100644 index 00000000..9ddcdebf --- /dev/null +++ b/e2e/cypress/component/1-store/actions/edges/updateEdge.cy.ts @@ -0,0 +1,34 @@ +import { useVueFlow } from '@braks/vue-flow' +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) + }) +}) diff --git a/e2e/cypress/component/1-store/actions/viewpane/setMaxZoom.cy.ts b/e2e/cypress/component/1-store/actions/viewpane/setMaxZoom.cy.ts index a9da2de1..515b1f64 100644 --- a/e2e/cypress/component/1-store/actions/viewpane/setMaxZoom.cy.ts +++ b/e2e/cypress/component/1-store/actions/viewpane/setMaxZoom.cy.ts @@ -3,7 +3,7 @@ import { getElements } from '../../../../utils' const { nodes } = getElements() -describe('Store Action: `setMinZoom`', () => { +describe('Store Action: `setMaxZoom`', () => { const store = useVueFlow({ id: 'test' }) beforeEach(() => {