feat(tests): add dragging nodes test
This commit is contained in:
@@ -2,7 +2,7 @@ import { getElements } from '../../utils'
|
|||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|
||||||
describe('render Vue Flow', () => {
|
describe('Render Basic Example', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.vueFlow({
|
cy.vueFlow({
|
||||||
modelValue: [...nodes, ...edges],
|
modelValue: [...nodes, ...edges],
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { getElements } from '../../utils'
|
||||||
|
|
||||||
|
const { nodes } = getElements(1, 1)
|
||||||
|
|
||||||
|
describe('Check if nodes are draggable', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.vueFlow({
|
||||||
|
modelValue: [nodes[0]],
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('drags nodes', () => {
|
||||||
|
cy.window().then((win) => {
|
||||||
|
cy.get(`[data-id="${nodes[0].id}"]`)
|
||||||
|
.trigger('mousedown', {
|
||||||
|
which: 1,
|
||||||
|
force: true,
|
||||||
|
view: win,
|
||||||
|
})
|
||||||
|
.trigger('mousemove', {
|
||||||
|
clientX: 100,
|
||||||
|
clientY: 100,
|
||||||
|
force: true,
|
||||||
|
})
|
||||||
|
.trigger('mouseup', {
|
||||||
|
force: true,
|
||||||
|
view: win,
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.get(`[data-id="${nodes[0].id}"]`).should('have.css', 'transform', 'matrix(1, 0, 0, 1, 17, 74)')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user