refactor(tests): rename e2e to tests

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-22 20:20:11 +01:00
committed by Braks
parent c60398d0f0
commit a3ec3b40a7
43 changed files with 10 additions and 1 deletions
@@ -0,0 +1,42 @@
import { useVueFlow } from '@vue-flow/core'
import { getElements } from '../../../utils'
const { nodes, edges } = getElements()
describe('Store State: `deleteKeyCode`', () => {
const store = useVueFlow({ id: 'test' })
beforeEach(() => {
cy.vueFlow({
nodes,
edges,
})
})
it('deletes node', () => {
cy.window().then(() => {
cy.get(`[data-id="${nodes[0].id}"]`).click()
cy.get('body').trigger('keydown', { key: 'Backspace' })
cy.tryAssertion(() => {
cy.get(`[data-id="${nodes[0].id}"]`).should('not.exist')
expect(store.nodes.value.some((node) => node.id === nodes[0].id)).to.equal(false)
})
})
})
it('changes key code', () => {
store.deleteKeyCode.value = 'Delete'
cy.window().then(() => {
cy.get(`[data-id="${nodes[0].id}"]`).click()
cy.get('body').trigger('keydown', { key: 'Delete' })
cy.tryAssertion(() => {
cy.get(`[data-id="${nodes[0].id}"]`).should('not.exist')
expect(store.nodes.value.some((node) => node.id === nodes[0].id)).to.equal(false)
})
})
})
})