wisemapping-frontend/packages/editor/cypress/e2e/topicManager.cy.ts
Paulo Gustavo Veiga 8bb538444e Change default icon
2023-01-07 13:22:33 -08:00

66 lines
1.8 KiB
TypeScript

context('Node manager', () => {
before(() => {
cy.visit('/editor.html');
// Wait for load complate ...
cy.get('[aria-label="vortex-loading"]').should('not.exist');
});
it('shortcut add sibling node', () => {
cy.contains('Mind Mapping').click({ force: true });
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
cy.get('[test-id=36] > text > tspan').should('exist');
cy.wait(200);
cy.matchImageSnapshot('editor-shortcut-edit');
});
it('shortcut add child node', () => {
cy.contains('Mind Mapping rocks!!').click({ force: true });
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.wait(200);
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.wait(200);
cy.matchImageSnapshot('deleteTopicShortcut');
});
it('undo changes', () => {
cy.get('[data-testid="UndoOutlinedIcon"]').click();
cy.get('[test-id=36] > text > tspan').should('exist');
cy.wait(200);
cy.matchImageSnapshot('undoChange');
});
it('redo changes', () => {
cy.get('[data-testid="RedoOutlinedIcon"]').click();
cy.get('[test-id=36] > text > tspan').should('exist');
cy.wait(200);
cy.matchImageSnapshot('redoChange');
});
it('Save changes', () => {
cy.contains('Mind Mapping rocks!!').click({ force: true });
cy.get('body').type('{ctrl}s');
cy.wait(200);
cy.matchImageSnapshot('saveChagesShortcut');
});
});