2023-01-08 07:27:01 +01:00
|
|
|
/// <reference types="cypress" />
|
2023-01-15 09:10:27 +01:00
|
|
|
describe('Topic Drag and Drop', () => {
|
2022-01-25 21:57:29 +01:00
|
|
|
beforeEach(() => {
|
2022-12-01 07:12:40 +01:00
|
|
|
// Remove storage for autosave ...
|
2022-01-25 21:57:29 +01:00
|
|
|
cy.visit('/editor.html');
|
2023-01-08 07:27:01 +01:00
|
|
|
cy.waitEditorLoaded();
|
2022-01-25 21:57:29 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Move up node "Mind Mapping"', () => {
|
|
|
|
const position = { clientX: 270, clientY: 160 };
|
|
|
|
cy.contains('Mind Mapping').trigger('mousedown');
|
|
|
|
cy.get('body').trigger('mousemove', position);
|
|
|
|
cy.get('body').trigger('mouseup');
|
|
|
|
cy.matchImageSnapshot('moveupNode');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Move down node "Mind Mapping"', () => {
|
|
|
|
cy.contains('Mind Mapping').trigger('mousedown');
|
|
|
|
cy.get('body').trigger('mousemove', { clientX: 350, clientY: 380 });
|
|
|
|
cy.get('body').trigger('mouseup');
|
|
|
|
cy.matchImageSnapshot('movedownNode');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Move default position node "Mind Mapping"', () => {
|
|
|
|
cy.contains('Mind Mapping').trigger('mousedown');
|
|
|
|
cy.get('body').trigger('mousemove', { clientX: 270, clientY: 240 });
|
|
|
|
cy.get('body').trigger('mouseup');
|
|
|
|
cy.matchImageSnapshot('moveDefaultPosition');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Move left node "Mind Mapping"', () => {
|
|
|
|
cy.contains('Mind Mapping').trigger('mousedown');
|
|
|
|
cy.get('body').trigger('mousemove', { clientX: 700, clientY: 240 });
|
|
|
|
cy.get('body').trigger('mouseup');
|
|
|
|
cy.matchImageSnapshot('moveleftNode');
|
|
|
|
});
|
|
|
|
});
|