tests: update nodes tests

This commit is contained in:
braks
2023-05-25 20:48:26 +02:00
committed by Braks
parent 910a3543f6
commit 669a2a3f8c
5 changed files with 60 additions and 23 deletions
@@ -22,7 +22,25 @@ describe('Store Action: `addNodes`', () => {
expect(store.nodes.value).to.have.length(nodes.length + initialNodes.length)
})
it('adds nodes to viewpane', () => {
it('adds nodes to view', () => {
cy.get('.vue-flow__node').should('have.length', nodes.length + initialNodes.length)
})
it('adds nodes to DOM', () => {
cy.get('.vue-flow__node').then((els) => {
els.each((index, node) => {
const nodeId = node.getAttribute('data-id')
const storedNode = store.findNode(nodeId)
expect(storedNode).to.not.eq(undefined)
expect(storedNode?.id).to.eq(nodeId)
})
})
})
it('does not add invalid nodes', () => {
// @ts-expect-error invalid nodes
store.addNodes([null, undefined, '', 0, false, true, {}, []])
expect(store.nodes.value).to.have.length(nodes.length + initialNodes.length)
})
})