mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-30 01:24:55 +01:00
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
|
context('Node manager', () => {
|
||
|
before(() => {
|
||
|
cy.visit('/editor.html');
|
||
|
});
|
||
|
|
||
|
it('shortcut add sibling node', () => {
|
||
|
cy.contains('Mind Mapping').click();
|
||
|
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
|
||
|
|
||
|
cy.get('[test-id=36] > text > tspan').should('exist');
|
||
|
|
||
|
cy.matchImageSnapshot('editor-shortcut-edit');
|
||
|
});
|
||
|
|
||
|
it('shortcut add child node', () => {
|
||
|
cy.contains('Mind Mapping rocks!!').click();
|
||
|
cy.get('body').type('{insert}').type('Child 1 mind Mapping rocks!!').type('{enter}');
|
||
|
cy.get('body').type('{enter}').type('Child 2 mind Mapping rocks!!').type('{enter}');
|
||
|
|
||
|
cy.get('[test-id=36] > text > tspan').should('exist');
|
||
|
cy.get('[test-id=37] > text > tspan').should('exist');
|
||
|
|
||
|
cy.matchImageSnapshot('addChildNodeSortcut');
|
||
|
});
|
||
|
|
||
|
it('Delete topic', () => {
|
||
|
cy.get('[test-id=37]').click();
|
||
|
cy.get('body').type('{del}');
|
||
|
|
||
|
cy.get('[test-id=37]').should('not.exist');
|
||
|
|
||
|
cy.matchImageSnapshot('deleteTopicShortcut');
|
||
|
});
|
||
|
|
||
|
it('undo changes', () => {
|
||
|
cy.get('#undoEditionTip').click();
|
||
|
|
||
|
cy.get('[test-id=36] > text > tspan').should('exist');
|
||
|
|
||
|
cy.matchImageSnapshot('undoChange');
|
||
|
});
|
||
|
|
||
|
it('Save changes', () => {
|
||
|
cy.contains('Mind Mapping rocks!!').click();
|
||
|
cy.get('body').type('{ctrl}s');
|
||
|
|
||
|
cy.matchImageSnapshot('saveChagesShortcut');
|
||
|
});
|
||
|
});
|