wisemapping-frontend/packages/editor/cypress/e2e/relationship.cy.ts
Paulo Gustavo Veiga 3a505224f6 Add test on push
2022-12-04 21:47:16 -08:00

37 lines
1.1 KiB
TypeScript

context('Relationship Topics', () => {
beforeEach(() => {
// Remove storage for autosave ...
cy.visit('/editor.html');
cy.clearLocalStorage('welcome-xml');
cy.reload();
// Wait for load complate ...
cy.get('svg > path').should('be.visible');
});
it('Add Relationship', () => {
cy.contains('Features').click();
cy.get(`[aria-label="Add Relationship"]`).first().click();
cy.contains('Try it Now!').click();
cy.get('[test-id="11-15-relationship"]').click();
cy.get('[test-id="11-15-relationship"]').should('exist');
cy.matchImageSnapshot('addRelationship');
});
it('Delete Relationship', () => {
cy.contains('Features').first().click();
cy.get(`[aria-label="Add Relationship"]`).first().click();
cy.contains('Try it Now!').first().click();
cy.get('[test-id="11-15-relationship"]').should('exist');
cy.get('[test-id="11-15-relationship"]').click();
cy.get('body').type('{backspace}');
cy.get('[test-id="11-15-relationship"]').should('not.exist');
cy.matchImageSnapshot('delete relationship');
});
});